[英]how do I set up a table view in interface builder for a 'settings' type interface
So I guess the table view has been designed around the idea of using dynamic data received at run time, but I want to make a settings type app where all of the cell values are known as I build it, so I was hoping to be able to set the section / row configuration, labels ect, as well as the properties for each cell (whether it has other views inside it like a switch, or whether it is a button etc) all in interface builder. 因此,我想表视图是围绕使用在运行时接收到的动态数据的想法而设计的,但是我想创建一个设置类型的应用程序,在此应用程序中,所有单元格值都将在构建时被知道,因此我希望能够可以在界面生成器中设置节/行的配置,标签等,以及每个单元格的属性(是否在其中像开关一样具有其他视图,或者是否是按钮等)。
can I do that? 我能做到吗? how? 怎么样?
I am using xcode 4.4.1 我正在使用xcode 4.4.1
To use static cell content you have to make sure that you are adding a UITableViewController
not just a UITableView
dragged into a UIViewController
. 要使用静态单元格内容,您必须确保要添加UITableViewController
而不只是将UITableView
拖放到UIViewController
。 The latter requires dynamic prototypes. 后者需要动态原型。
Once you've added the table view controller to your storyboard it is as simple as selecting "static cells" in the attributes inspector. 将表视图控制器添加到情节提要中后,就像在属性检查器中选择“静态单元格”一样简单。 From there you can drag and drop UITableViewCells
and modify them as you wish. 从那里,您可以拖放UITableViewCells
并根据需要对其进行修改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.