tableView plain样式和group样式区别
来源:互联网 发布:advanced mac cleaner 编辑:程序博客网 时间:2024/05/17 09:26
Table views can have one of two styles, UITableViewStylePlain and UITableViewStyleGrouped. When you create a UITableView instance you must specify a table style, and this style cannot be changed. In the plain style, section headers and footers float above the content if the part of a complete section is visible. A table view can have an index that appears as a bar on the right hand side of the table (for example, "A" through "Z"). You can touch a particular label to jump to the target section. The grouped style of table view provides a default background color and a default background view for all cells. The background view provides a visual grouping for all cells in a particular section. For example, one group could be a person's name and title, another group for phone numbers that the person uses, and another group for email accounts and so on. See the Settings application for examples of grouped tables. Table views in the grouped style cannot have an index.
文档写的很详细,plain和group样式。一般而言,plain也就是我们常说的普通样式,在我看来,普通样式就是一个块(可以是一个或者多个分区)如下图这样:
普通视图主要用于动态表,而动态表一般在单元格数目未知的情况下使用
而分组样式呢,就是一个一个的块,特别分明的那种,就像文档中说的,一个组可以是人的名字和标题,另一个分区可以是这些人的电话号码,另一个分区可以是这些人的电子邮件等都可以,像下图这样:
分组样式一般用于静态表,用于界面布局,分组样式会把表分成很多“孤岛”,这些孤岛由一些类似的单元格组成。
了解了table的两种样式,以后根据需要来使用
分组样式也是可以用普通样式(基础样式)写出来的。
注意点:我们在定义table为分组样式时,他会有默认的分区高的,这个时候,我们如果不要这个分区高的话,应该return 0.01,不能是return 0;(return 0相当于是没有设置,是没有效果的)
如下图:我就是定义了一个静态样式来做的:
思路:静态样式表,"this is a label"是头视图。里边共用了两个分区,四类cell完成
- tableView plain样式和group样式区别
- UITableview Group 与plain 样式区别
- tableView的plain 和grouped 样式
- tableview的plain与group区别
- TableView Group样式中的控件
- tableView的 Plain 和 Grouped 区别
- tableview样式
- group样式的tableView 改变第一组顶部距离
- iOS Tableview中解决plain样式下,header的浮动问题
- 自定义tableview Header和Footer的样式
- 链接样式表和导入样式区别
- tableView编辑样式设计
- 【iOS开发-58】tableView初识:5个重要方法的使用和2种样式的区别
- 继承UITableViewController,更改tableview样式
- 左滑时修改tableview中的样式
- react和react-native样式区别
- js和css的外部样式区别
- tableView cell的几种样式样式 右侧带图片
- Retrofit框架(入门级)
- 关于发邮件报错535 Error:authentication failed解决方法
- 响应式布局设置--@media only screen and (转载)
- 汇编语言学习第十二章-内中断
- uva10328(递推)
- tableView plain样式和group样式区别
- Jupyter Notebook的快捷键
- hdu 1159 最长公共子序列
- EventBus的使用详解
- nyoj 737 合并石子一(dp)
- 项目导入eclipse中无法启动虚拟器
- Jlink20P接口定义
- @RequestMapping
- io流写入操作日记记录中换行需要注意的点