问题描述
我想将减号移到右边。我该怎么办?
I want to move the minus sign to the right. How do I do that?
谢谢!
推荐答案
我不喜欢不知道是否可能,但我首先考虑继承 UITableViewCell
并覆盖其 layoutSubviews
方法。
I don't know if it's possible, but I'd start by looking into subclassing the UITableViewCell
and overriding its layoutSubviews
method.
但我不相信你可以,你只能访问 contentView
, accessoryView
, backgroundView
,而不是 deleteConfirmationView
。您可以在是布尔 showsDeleteConfirmation
。
But I don't believe you can, you only have access to the contentView
, the accessoryView
, the backgroundView
, not the deleteConfirmationView
. The closest thing you can find in UITableViewCell
's reference is the boolean showingDeleteConfirmation
.
所以你可以尝试继承 UITableViewCell
,并通过回复 willTransitionToState:
来添加你想要的删除确认按钮。当新状态是 UITableViewCellStateShowingDeleteConfirmationMask
。
So you could try subclassing the UITableViewCell
and adding your own delete confirmation button where you want, by responding to willTransitionToState:
when the new state is UITableViewCellStateShowingDeleteConfirmationMask
.
这篇关于UITableViewCell编辑减号框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!