修改UITableViewCell滑动删除按钮标题
来源:互联网 发布:linux装进u盘 编辑:程序博客网 时间:2024/05/16 14:00
参考:http://code4app.com/snippets/one/自定义UITableViewCell上的delete按钮/513ea0586803faee3c000000
//通过UITableViewDelegate方法可以实现删除 tableview中某一行
//滑动删除
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
[bookInforemoveObjectAtIndex:row];//bookInfo为当前table中显示的array
[tableView deleteRowsAtIndexPaths:[NSArrayarrayWithObject:indexPath]withRowAnimation:UITableViewRowAnimationLeft];
}
/*此时删除按钮为Delete,如果想显示为“删除” 中文的话,则需要实现
UITableViewDelegate中的- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath方法*/
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
return @"删除";
}
//或者,最简单的方式,将plist中的Localization native development region改为China即可
//通过UITableViewDelegate方法可以实现删除 tableview中某一行
//滑动删除
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
[bookInforemoveObjectAtIndex:row];//bookInfo为当前table中显示的array
[tableView deleteRowsAtIndexPaths:[NSArrayarrayWithObject:indexPath]withRowAnimation:UITableViewRowAnimationLeft];
}
/*此时删除按钮为Delete,如果想显示为“删除” 中文的话,则需要实现
UITableViewDelegate中的- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath方法*/
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
return @"删除";
}
//或者,最简单的方式,将plist中的Localization native development region改为China即可
0 0
- 修改UITableViewCell滑动删除按钮标题
- UITableViewCell:隐藏删除按钮和设置删除按钮的标题
- UITableViewCell 滑动删除
- iOS - UITableViewCell滑动删除
- iOS UITableViewCell滑动删除
- 修改UITableViewCell左滑删除按钮的样式和自定义
- 向左或向右滑动在任何地方一个UITableViewCell删除的单元格没有删除按钮?
- UITableViewCell滑动删除及移动
- UITableViewCell滑动删除及移动
- UITableViewCell滑动删除及移动
- UITableViewCell滑动删除及移动
- UITableViewCell滑动删除及移动
- UITableViewCell左滑动删除 和cell上按钮的点击事件
- iOS UITableViewCell"滑动出现多个按钮"
- 滑动UITableViewCell出现多个按钮
- UITableView滑动删除表格行(UITableViewCell)
- iOS UITableViewCell 表格式图滑动删除
- 自定义UITableViewCell上的删除按钮
- iOS7 修改状态条文字的颜色为白色的 正确方法
- iOS 应用程序图标去除高亮的光圈效果
- 用Axure RP7创建响应式原型教程
- Tuxedo中间件开发和管理
- 微信公众平台开发教程-新手解惑
- 修改UITableViewCell滑动删除按钮标题
- 导航栏常用代码
- 数据库设计
- retainCount不能返回对象真实的被引用的次数
- 查看mysql编码
- iOS 手势并存
- HDOJ 题目1509 Be the Winner(anti-nim)
- iOS开发---网址收藏
- HTML前端ajax请求