您好,当用户在我的 tableview 中滑动 uitableviewcell 时,我正在尝试更改删除按钮中显示的文本。
我在另一个问题线程中看到了一个例子,上面说要使用这个 tableview delegate
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
我的问题是,我该如何使用这种方法。我不确定如何使用它。
最佳答案
在管理 UITableView
的 Controller 中,您应该实现 UITableviewDelegate
并在 titleForDeleteConfirmationButtonForRowAtIndexPath
方法中返回您想要的方法标题。
例子:
@interface CategoryAddViewController : UITableViewController
@end
@implementation CategoryAddViewController
// ...
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"Please don't delete me!";
}
@end
让你离开这样的事情:
关于iphone - 如何更改uitableview删除按钮文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7394988/