表视图在应用软件开发中会常常用到,应用程序的扩展都是通过选中某行来进行的,但是并不是整 个表视图的每行都会有扩展,所以需要我们以不同的方式去告诉用户。在表视图中是通过一个enum的枚举类型 UITableViewCellAccessoryType来达到这种目的,
UITableViewCellAccessoryType声明如下:
typedef enum {
UITableViewCellAccessoryNone, // don't show any accessory view
UITableViewCellAccessoryDisclosureIndicator, // regular chevron. doesn't track
UITableViewCellAccessoryDetailDisclosureButton, // blue button w/ chevron. tracks
UITableViewCellAccessoryCheckmark // checkmark. doesn't track
} UITableViewCellAccessoryType;
我们可以通过得到一个cell,然后给它的属性accessoryType设置相应的value即可。三种格式分别如下图:



UITableViewCellAccessoryCheckmark 用户当前选择了某行。
本文介绍了在应用软件开发中如何使用UITableViewCellAccessoryType枚举来实现表视图的不同扩展样式,包括扩展指示器、细节展示按钮及选中状态标记。
74

被折叠的 条评论
为什么被折叠?



