本文介绍了在 UITableView 中执行 commitEditingStyle 时,如何制作“删除按钮"的自定义视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我想自定义在表格视图单元格上执行向左滑动"操作时显示的删除按钮.我目前设置了 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/blog/reproduce-the-ios-7-mail-apps-interface/
推荐答案
这可能对你有帮助.
- (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];
}
}
}
}
引用自:
自定义UITableView中的删除按钮
为uitableview创建自定义删除按钮
自定义删除按钮在 UITableView 单元格中编辑
这篇关于在 UITableView 中执行 commitEditingStyle 时,如何制作“删除按钮"的自定义视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)