在 iPhone 中滚动后,披露指示器从其位置移动
我面临一个奇怪的问题。在表格视图中,我有 3 个部分,其中第 1 部分只有标签和文本字段。第 2 部分和第 3 部分包含表格某些单元格上的文本字段和公开指示符。假设第 2 部分有 10 个单元格,则第 3 部分包含公开指示符和其他具有文本字段的单元格。
我的问题是,当我上下滚动视图(例如 3-4 次)时,披露指示符单元格会从该位置移动并放置在该部分中的任何位置。如果我继续向前滚动,披露指示器将再次放置到该位置。如果我删除这些披露指示器并仅放置文本字段,则一切都会运行良好。
我还尝试在 cellForRowAtIndexPath 中使用 switch case(如以下链接中所述),但没有任何帮助我......:( http://www.iphonedevsdk。 com/forum/iphone-sdk-development/13370-uitableview-cells-uilabel-problem.html
我做了很多谷歌,但无法找到解决方案。
请帮助我...
问候, 虚拟机
I am facing a strange problem. In a table view, I am having 3 sections out of which 1st section is having only labels and text fields. 2nd and 3rd section contains text fields and disclosure indicator on some cells of table.Say 2nd section is having 10 cells, then 3 contains disclosure indicator and other having text fields.
My problem is when I scroll the view up and downs, say 3-4 times, the disclosure indicator cells are shifted from there position and are placed on any location in that section. If I continue to scroll ahead, disclosure indicator are placed to there position again. If I remove those disclosure indicator and place only text fields all runs well.
I also tried using switch case in cellForRowAtIndexPath (as mentioned in following link), but nothing helping me out... :(
http://www.iphonedevsdk.com/forum/iphone-sdk-development/13370-uitableview-cells-uilabel-problem.html
I did a lot google, but not able to find a solution for this.
Please help me in this...
Regards,
VM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请找到代码供您参考。
第一部分包含 6 个单元格,第二部分包含 12 个单元格,与第三部分相同。在第二部分和第三部分中,第 4、8、9 号单元格包含披露指示符,其他单元格仅包含文本字段。
}
Please find the code for your reference.
First section contains 6 cells, 2nd section contains 12 and same with 3rd section. In 2nd and 3rd section cell no 4,8,9 contains disclosure indicators, other cells contains only text fields.
}
尝试在分配 cell 后进行所有初始化,如果之前为 nil,则不进行条件调整。
含义:
现在单元格初始化的其余部分(它是子视图等等)
Try to do all the initialization after you allocate the cell , without conditioning if it was nil before.
Meaning :
Now the rest of initialization of the cell (it's sub views and more)