简体   繁体   中英

UITableView - Last static cell disappears, shows at top of previous section

I have a basic UITableView with 2 sections of static cells and UITextFields for form entry. There are enough fields that the view needs to scroll. The problem I'm having is that when I test the app on my device, the last cell disappears from the bottom of the last section and reappears at the bottom of the first section.

Anyway, it seems something is getting confused about which section it's supposed to be rendering. This only happens on the last cell in the UITableView .

This does not happen in Simulator. Running iOS 6.0.

Can anyone tell me why this is happening and how to fix it?

Here's a link to an screenshot:

My guess is that in this data delegate method:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

You are not looking at both section and row, but just row, or that when you go to fetch your cell the logic is not accounting for both section and row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM