.xib中没有UITableView的内容属性 [英] No content attribute for UITableView in .xib

查看:826
本文介绍了.xib中没有UITableView的内容属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(XCode 4.2,iOS 5)

(XCode 4.2, iOS 5)

为了重用tableview(使用导航栏和编辑/添加按钮),我创建了一个 UITableViewController 子类与它自己的 .xib 。然而,当我添加一个 UITableView 到我的 .xib 的主视图内容属性(我想设置到动态原型)它不会出现。它只显示示例内容( California:Brea,Burlingame,... )。当我在我的主要故事板中添加 UITableView 时,会显示内容属性。

In order to reuse a tableview (with a navigation bar and edit/add buttons) I created a UITableViewController subclass with it's own .xib. However, when I add a UITableView to my .xib's main view the content attribute (which I want to set to dynamic prototypes) it doesn't show up. It just shows the sample content (California: Brea, Burlingame, ...). When I add a UITableView in my main storyboard the content attribute does show up.

问题是什么? / p>

What is the issue?

推荐答案

对于试图解决这个问题的人,不可能在 .xib ,甚至静态单元格。在 .xib 文件中不支持嵌入节或单元格。
如果将表视图控制器拖动到 .xib 中,您会收到一个错误:

For people trying to solve this, it is impossible to set dynamic prototypes cells in a .xib, or even static cells. No embedded sections or cells are supported in .xib files. If you drag a Table View Controller into a .xib, you'll get an error:


只有
storyboard文档支持嵌入节和单元格的表视图

Table views with embedded sections and cells are only supported in storyboard documents

Xcode 6.3 .2

Xcode 6.3.2

这篇关于.xib中没有UITableView的内容属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆