UITableView的三种accessory扩展

表视图在应用软件开发中会常常用到,应用程序的扩展都是通过选中某行来进行的,但是并不是整 个表视图的每行都会有扩展,所以需要我们以不同的方式去告诉用户。在表视图中是通过一个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即可。三种格式分别如下图:

UITableView的三种accessory扩展 - tergol - tergol的博客UITableView的三种accessory扩展 - tergol - tergol的博客UITableView的三种accessory扩展 - tergol - tergol的博客
NOTE:  UITableViewCellAccessoryDetailDisclosureButton这个对应上面第一个图,称为细节展示按钮,只有点到按钮 图标才会跳转;  UITableViewCellAccessoryDisclosureIndicator  表示扩展指示器,只要选择带有它的某行,就可以实现视图的跳转;
 UITableViewCellAccessoryCheckmark 用户当前选择了某行。    

 

转:

http://tergol.blog.163.com/blog/static/170695028201081571326731/

posted @ 2011-10-21 11:34  Maxfong  阅读(4568)  评论(0编辑  收藏  举报