简体   繁体   中英

iOS TableView combine Static Cells and Dynamic Prototypes

I have a UITableView in an app that I'm developing. I currently have it set up to use Static Cells, so that I can use the UITableView just like its made up of regular text fields on a view, but presented in the nice, scrolley table view.

While this works great for the current functionality of the app, I'd like to be able to have one table view with a section at the top that has static cells in it, and another section at the bottom that is set up to use the regular -tableView:cellForRowAtIndexPath:indexPath with dynamic cell prototypes.

Is this possible, or is this bad app design? Should my static cells be in some sort of header on the top of the table view, or can they be put in with the rest of the table?

You can not combine static and dynamic table view's into one table.

Your best bet, is to create a dynamic table view and supply your "static" content in code via cellForRowAtIndexPath and willDisplayRowAtIndexPath routines for the appropriate section.

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