UITableView的cell向左滑出有删除,修改等选项
2016-04-01 17:02
423 查看
效果图:
只需实现UITableView Delegate的一种方法即可:
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *modifyAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"修改" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
}];
modifyAction.backgroundColor = MC_Color_DeepGray;
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
}];
deleteAction.backgroundColor = MC_Color_StandRed;
return @[ modifyAction,deleteAction];
}
只需实现UITableView Delegate的一种方法即可:
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *modifyAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"修改" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
}];
modifyAction.backgroundColor = MC_Color_DeepGray;
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
}];
deleteAction.backgroundColor = MC_Color_StandRed;
return @[ modifyAction,deleteAction];
}
相关文章推荐
- android roboguice 笔记
- Your build settings specify a provisioning profile with the UUID, no provisioning profile was found
- CUICatalog: Invalid asset name supplied: (null), or invalid scale factor: 2.000000错误解决方案
- Android ui 透明度设置
- 62. Unique Paths
- 为什么request.getParameterValues("XXX")接收select数组的值为null
- 在使用jsonCPP过程中,使用Debug正常,但是使用Relese出现找不到json_value.asm
- 怎么强制一个UIViewController页面从竖屏进入横屏
- 关于tableViewCell行数移动的方法。记得跟后台数据交互,这只是本地展示时候的样子。
- Android Volley完全解析(三),定制自己的Request
- request 对象
- c#中获取服务器IP,客户端IP以及Request.ServerVariables详细说明
- lintcode-medium-N Queens II
- lintcode-medium-N Queens
- UITextField 解决限制文字长度不准确的问题
- Vue.js实例练习
- 仿 UIAlertView动画效果
- Android之UI控件
- 【转载】循环结构中break、continue、return和exit的区别
- iOS-------UITableView