IKK*_*KKA 5 iphone objective-c uitableview ios xcode6
我正在使用以下代码在xcode6中使用ios8.0轻扫UITableViewCell.我的代码工作正常,但我需要为UITableViewRowActions设置相等的宽度(更多,删除等).怎么可能?请帮帮我..
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@“More” handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
}];
UITableViewRowAction *flagAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@“Flag” handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
}];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// [self.objects removeObjectAtIndex:indexPath.row];
}];
return @[deleteAction,flagAction,moreAction];
}
Run Code Online (Sandbox Code Playgroud)
我知道这远非完美,但我为标题添加了空字符串
[UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@" "
Run Code Online (Sandbox Code Playgroud)
然后我使用图像
block.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"block"]];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2024 次 |
| 最近记录: |