单击 editButtonItem 时,不显示红色删除图标
我现在正在写一个iPhone IM聊天窗口。
您知道,如果 UITableviewController 中的 nagviationItem.rightBarItem 设置为 editButtonItem,则单击编辑按钮,然后每行都会显示一个红色删除图标, 如此处所示。
问题是,我有一个 UIViewController 而不是 UITableViewController:
@interface ChatUIViewController : UIViewController<UITableViewDelegate,UITableViewDataSource>{
UITableView *table;
UITextField *textField;
}
并且我做了同样的设置 editButtonItem:
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
当我单击编辑按钮时, 红色删除图标将不会显示。
如何使我的 ChatUIViewController 中显示红色删除图标?
预先感谢任何可能提供帮助的人。 迈克尔
I am writing an IPhone IM chat window now.
You know if the nagviationItem.rightBarItem in an UITableviewController is set to editButtonItem, you click the edit button then a red delete icon is shown to every single row, like shown here.
The problem is, I have a UIViewController instead of a UITableViewController:
@interface ChatUIViewController : UIViewController<UITableViewDelegate,UITableViewDataSource>{
UITableView *table;
UITextField *textField;
}
and i did same to set editButtonItem:
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
when i click the edit button, the red delete icon will not show.
How can I make the red delete icon shown in my ChatUIViewController?
Thanks in advance to anyone who might help.
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下方法添加到表视图委托类中:
Add the following method to your table view delegate class: