如何将 UITableView 设置为分组样式 [英] How can I set a UITableView to grouped style

查看:35
本文介绍了如何将 UITableView 设置为分组样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有部分的 UITableViewController 子类.这些部分以默认样式(无圆角)显示.如何在代码中将 TableView 样式设置为分组?我没有为此使用 Interface Builder,所以我需要类似

I have a UITableViewController subclass with sections. The sections are showing with the default style (no rounded corners). How can I set the TableView style to grouped in the code? I'm not using Interface Builder for this, so I need something like

[self.tableView setGroupedStyle]

我在 Stack Overflow 上搜索过,但找不到答案.

I searched on Stack Overflow, but couldn't come up with an answer.

推荐答案

如果我明白你的意思,你必须用那种风格初始化你的控制器.类似的东西:

If i understand what you mean, you have to initialize your controller with that style. Something like:

myTVContoller = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];

这篇关于如何将 UITableView 设置为分组样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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