我怎样才能让“删除按钮”的自定义视图的UITableView内进行commitEditingStyle时 [英] How can I make a custom view of the 'delete-button' when performing commitEditingStyle within a UITableView
问题描述
我想自定义的删除按钮上的tableview细胞进行刷卡到left'动作时被显示。我公司目前成立了一个UITableViewCell的一个子类,但也希望自定义删除按钮正在被显示。
I would like to customize the delete button which is shown when performing the 'swipe to left'-action on a tableview cell. I currently set up a subclass of a UITableViewCell but also want to customize the delete-button which is being shown.
我的目标是当刷卡放置三个按钮。
My goal is to place three buttons when swiping.
我选择,我是用一个UIScrollView在每个单元另一种实现。
I choose for another implementation where I was using a UIScrollview in each cell.
http://www.teehanlax.com /博客/再现最IOS-7-邮件应用程序接口/
推荐答案
这可能会帮助你。
- (void)willTransitionToState:(UITableViewCellStateMask)state
{
[super willTransitionToState:state];
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask)
{
for (UIView *subview in self.subviews)
{
if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"])
{
UIImageView *deleteBtn = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 64, 33)];
[deleteBtn setImage:[UIImage imageNamed:@"arrow_left_s11.png"]];
[[subview.subviews objectAtIndex:0] addSubview:deleteBtn];
}
}
}
}
从引用:
<一个href=\"http://stackoverflow.com/questions/13669920/customize-the-delete-button-in-uitableview\">Customize在UITableView的删除按钮
<一个href=\"http://stackoverflow.com/questions/1615469/custom-delete-button-on-editing-in-uitableview-cell\">Custom删除按钮编辑在UITableView的细胞
这篇关于我怎样才能让“删除按钮”的自定义视图的UITableView内进行commitEditingStyle时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!