开发者

Editing Style of UITableView - Add/Delete

I added the following code in my UITableViewController subclass, it shows something like in the screen shot, which is like a radio button, can select/deselect it. Selected button does have red-colored tick symbol. What is the button meant for?

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 
return UITableViewCellEditingStyleDelete | UITabl开发者_JAVA百科eViewCellEditingStyleInsert; 
}  

Editing Style of UITableView - Add/Delete


The function you have used is for selecting value/values from the list in the table view. But before you use this function you have to include two more functions in your viewController :

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath  

- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath  

You can use the selected value of the list somewhere else, may be in the next viewController.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜