How to visually create and use static cells in a UITableView embedded in a UIViewController

后端 未结 6 994
深忆病人
深忆病人 2020-11-30 18:34

I\'m using XCode 4.2 and have built my UI using Storyboards. I need to create a view that has content above and below a UITableView and I can achieve this by using a UIViewC

6条回答
  •  误落风尘
    2020-11-30 18:58

    You can achieve this in Xcode 4.5 and later versions, assuming your app is targeted at iOS 6+.

    In the Storyboard simply create a UIViewController with a View Container inside it's main view. Then hook up that View Container to a UITableViewController that contains static cells.

    Just like this:

    enter image description here

    You don't need a single line of code. Just control click, drag and select embed. The view controller containment is handled for you.

提交回复
热议问题