UITableView 样式设置为“Grouped”,但程序使用“Plain”在 iPhone 上

发布于 2024-09-05 17:29:02 字数 485 浏览 1 评论 0 原文

我使用 XIB 创建了基于 UITableViewController 的类。在 XIB 中,我已将样式更改为“分组”。不幸的是,当我构建应用程序时,该表变成了“普通”。可能有什么问题?

我尝试过“清理所有目标”。没有成功。

替代文本

编辑:问题已解决。如您所知,您必须将视图添加到父控制器 xib。这次控制器的设置类型还不够。我还必须提供 xib 路径。这解决了问题。

I have created UITableViewController based class with XIB. In XIB I have changed style to "Grouped". Unfortunately, when I build the application, the table turns out to by "Plain". What might be a problem?

I have tried "Cleaning all targets". No success.

alt text

alt text

EDIT: Problem solved. As you know you have to add the view to the parent controller xib. This time setting type of the controller wasn't enough. I also had to provide xib path. That fixes the problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

撩动你心 2024-09-12 17:29:02

尝试重置模拟器,然后重新启动 sim 和 xcode。

Try resetting the simulator, and restarting the sim and xcode.

少女七分熟 2024-09-12 17:29:02

覆盖此方法以指定组数

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return [Arr count];
}

在此处返回组数

Override this method to specify number of groups

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return [Arr count];
}

return the number of groups here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文