Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

When we add a TableView to a XIB or to a storyboard, we can use static cells for pages that don’t change very often, Settings pages, personal information pages, things that don’t change very often.

1. Add the tableView

Let’s just set itStatic cell, will report an error, sayStatic cells are only available in UITableViewControllerIn the Settings.We can set that in our codeviewIn thecontainerViewThe size of us instroyboardCan also be set

We addcontainerViewI’ll bring one with meviewController

Let’s take thisview ControllerReplace with itTableViewControllerTo associate

After the association is successful, it can be addedStatic cellthe

2. Add static cells

We imitated the Settings page of Alipay, added static cells, and customized UI Settings according to cell styles

We choosegroupType and setcolor

It’s going to look something like this

Let’s adjustspacing

It’s almost done, a little bit less head, so we can set oneThe headerView tableview

Section placeDrag one inviewwhenheaderView, and set thehighly.

After running, the effect is almost enough

We can do thatCell Indicates the jump to clickWhen choosing behavior

So that’s all about theOr storyboard xibFor in theStatic cellI will share some more laterOr storyboard xibUse tips and follow me to share more tips.