![]() |
1
23
我的密码对我不起作用。但这是可行的。 - (void)willTransitionToState:(UITableViewCellStateMask)state { [super willTransitionToState:state]; if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask) { for (UIView *subview in self.subviews) { if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"]) { subview.hidden = YES; subview.alpha = 0.0; } } } } - (void)didTransitionToState:(UITableViewCellStateMask)state { [super didTransitionToState:state]; if (state == UITableViewCellStateShowingDeleteConfirmationMask || state == UITableViewCellStateDefaultMask) { for (UIView *subview in self.subviews) { if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"]) { UIView *deleteButtonView = (UIView *)[subview.subviews objectAtIndex:0]; CGRect f = deleteButtonView.frame; f.origin.x -= 20; deleteButtonView.frame = f; subview.hidden = NO; [UIView beginAnimations:@"anim" context:nil]; subview.alpha = 1.0; [UIView commitAnimations]; } } } } |
![]() |
2
58
对我来说,解决这个问题的最好办法是
在这里,您不仅可以看到“删除”按钮的自定义位置,还可以重新定位“编辑”和“重新排序”控件 编辑 模式
|
![]() |
3
2
我无法更改“删除”按钮的实际外观,但您可以更改文本。也许你可以用这个来达到你想要的效果?
查看以下成员
此外,还可以通过子类化来检测何时显示“删除”按钮。
对于其中任何一个,状态掩码都将
希望这些线索能为你指明正确的方向。 |
![]() |
4
2
我使用的解决方案乍一看似乎有点黑客,但却能做到这一点,而且不依赖于未注册的API:
基本上,这改变了细胞的位置,重新调整了可见的部分。 willTransitionOnState只设置一个实例变量,指示单元格是否处于删除模式。需要覆盖setframe来支持将手机旋转到横向,反之亦然。 其中,background是我的单元格的背景视图,content是添加到单元格的content view中的视图,包含所有标签等。 |
![]() |
5
1
我不知道“把删除按钮向左移动10px”的方法。但是,您可以通过监听
引用文档:
你要找的是
|
![]() |
6
0
我不知道最终的解决方案,但就我而言,下面的代码可能有用。
|