Mixing static and dynamic sections in a grouped table view

后端 未结 2 1942
北恋
北恋 2020-12-07 23:58

I need a grouped UITableView similar to the one for Twitter accounts in Settings app:

\"Twitter

2条回答
  •  难免孤独
    2020-12-08 00:12

    Static is just a provision on top of dynamic layout. Basically static is a WYSIWYG.

    If you are not resistant to experiment with values, I would recommend go dynamic. There are hundreds of examples available, such as this and this.

    As you go further, you would see yourself diverging towards two options when customizing dynamic table views:

    • Subclass UITableViewCell (more effort , but good in the long run). Again, follow this.
    • Play with UITableViewCell properties inside cellForRowAtIndexPath: (less effort and quick result but may or may not be performance-friendly due to possible redrawing)

    The possibilities are endless, such as here where cell background view is customized.

提交回复
热议问题