UITableViewCell就像iphone上的邮件一样 [英] UITableViewCell like mail on iphone
问题描述
如何调整UITableViewCell,以便在向左滑动后显示两个字段 - 与邮件客户端的操作方式相同?
现在我只看到删除按钮。
我想在那里也包含更多字段...
How can I adjust a UITableViewCell so that it would show two fields after swiping it left - identical to how the mail client does it? Right now I only see the "Delete" button. I would like to have the "More" field included there, too...
另外,对于第一个if子句Cell我没有得到插入field。
Also, for the first if clause Cell I do not get a "Insert" field.
- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.row == self.reports.count){
return UITableViewCellEditingStyleInsert;
} else {
return UITableViewCellEditingStyleDelete;
}
}
有没有办法将字段与|操作员还是什么?
谢谢,EL-
Is there a way to combine the fields with the | operator or something? Thanks, EL-
推荐答案
您可以在iOS7中为 UITableView 使用未记录的委托方法
You can use undocumented delegate methods for UITableView in iOS7
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"More";
}
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath
{
[self setEditing:NO animated:YES];
}
它们似乎不是私密的,可以提交给appStore。
It seems that they are not private and can be submitted to appStore.
这篇关于UITableViewCell就像iphone上的邮件一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!