您的位置:首页 > Web前端

4.5 Using Different Types of Accessories in a Table View Cell

2013-11-19 16:53 477 查看
UITableViewCell有个accessoryType属性,你可以为其赋UITableViewCellAccessoryType中的任意值。其中有两个非常有用disclosure indicator(详情标识),和detail disclosure button(详情按钮)。他们都显示一个向右的小箭头来告诉用户,这里还有下文。他们的区别在于disclosure indicator(详情标识)并不触发事件,而detail disclosure button(详情按钮)会触发一个事件。这时拥有详情按钮行就可以触发两个事件,一个是触发cell的事件,一个触发按钮的事件。那如何来捕捉按钮事件呢?delegate那是肯定的。

- (void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

{

/* Do something when the accessory button is tapped */

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐