iphone 桌面视图滚动问题

发布于 12-05 17:02 字数 148 浏览 0 评论 0原文

我有一个表格视图,每个单元格中都有图像视图和文本视图。当我的视图加载时,其中一个文本视图是不可见的。但是当我开始滚动时,文本视图就会出现,以便我的视图看起来像它应该的样子。有谁知道为什么会发生这种情况? PS我已经读过有关滚动时重用单元格的内容,因此我非常小心地正确构建我的单元格。

I have a tableview with imageviews and textviews in each cell. When my view is loaded one of the textviews is invisible. But when I start scrolling the textview appears, so that my view looks as it is supposed to look. Does anyone know why this is happening?
P.S. I have read about reusing cells when scrolling so I have been very careful to construct my cells correctly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴梦一场2024-12-12 17:02:47

没有代码,没有人能给你准确的答案。但猜测一下......

您的数据是否在表调用 cellForRowAtIndexPath 之后被填充?当单元格第一次填充时,没有数据,因此单元格处于未格式化状态。当您可以与表格交互并将其滚动到屏幕上时(再次调用 cellForRowAtIndexPath),数据已填充,因此单元格看起来符合预期。

您可以通过在 cellForRowAtIndexPath 方法中放置一个断点来测试这一点,并检查数据对象是否已初始化或仍设置为 nil。

Without code, no one can give you a exact answer. But for a guess....

Is your data is getting populated after your table call cellForRowAtIndexPath? When the cell populates the first time, no data, so the cell is in it's unformatted state. By the time you can interact with the table and scroll it off and on screen (which calls cellForRowAtIndexPath again), the data has been populated and so the cell looks as expected.

You can test this by putting a breakpoint in your cellForRowAtIndexPath method and check to see if your data objects are initialized or still set to nil.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文