Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
554 views
in Technique[技术] by (71.8m points)

uitableview - Table View Cells jump when selected on iOS 8

I'm trying to update my apps for iOS 8 and one strange issue that I can't figure out is that whenever I press a table view cell (on a grouped table view) and push another view controller on to the navigation controller, all the cells of the table view jump. It's sort of like they all reduce their height a little bit.

Consequently, when popping the navigation stack and coming back to the original table view screen, the cells jump again, this time they increase their height and going to back to how they were originally.

I have tried using a UITableViewController, doing my own table view management, not using explicity section heights, removing all custom header views and frames, basically anything I could think of.

It's happening on all the iOS 8 emulators and on actual devices runnings iOS 8 both iPhones and iPads.

Any suggestions will really help.

Edit: removed video

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Alright, so if you're using the default UITableViewCells and setting custom fonts for the textLabel and detailTextLabel, make sure you either set rowHeight for the table view or implement one of the UITableViewDelegate methods for e.g. tableView:estimatedHeightForRowAtIndexPath:

The same code has worked fine on earlier versions of iOS, but needs fixing on iOS 8 for some reason.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...