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 */
}
- (void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
/* Do something when the accessory button is tapped */
}
相关文章推荐
- numberOfSectionsInTableView:,tableView:numberOfRowsInSecion:,tableView:cellForRowAtIndexPath:
- 解决警告:View.propTypes has been deprecated and will be removed in a future version of ReactNative
- UITableView 知识更新A table view displays a list of items in a single column. UITableView is a subclas
- [numberOfSectionsInTableView:]: message sent to deallocated instance 0x17c8bc00
- Customerize NSTableHeaderCell and apply it in tableview
- Q6:关于xcode TableView使用Nib文件出现Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:错误
- How to create different types of thread pool in Java
- Different ways of associating known types in wcf
- iOS7 table view embedded in tab bar doesn't display last cell
- 删除tableview的section遇到crash:The number of rows contained in an existing section after the update
- iOS7 tableview separatorInset cell分割线左对
- How-to find the SQL that using lots of temp tablespace in Oracle
- LSCTableView: Building an Open, Drop-in Replacement of UITableView
- Oracle 12C ORA-01792: maximum number of columns in a table or view is 1000
- 93.View the Exhibit and examine the structure of the CUSTOMERS table. Using the CUSTOMERS table, y o
- iOS8 tableview separatorInset cell分割线左对齐,ios7的方法失效了
- Cell-Based to View-Based Table Views in Cocoa
- iOS7 tableview separatorInset cell分割线左对齐
- iOS7 tableview separatorInset cell分割线左对齐
- The different types of polymorphism in OOP-面向对象程序设计中的多态类型