当UITableViewCell
被刷right to left
时,tableView:canEditRowAtIndexPath:
被解雇,delete button
显示在UITableViewCell
的右侧。
我想在left to right
- >用户滑动时执行相同的操作显示Delete and More
按钮horizontally split
。
我正在关注符合我要求的this项目。我的疑问是如何将自定义按钮拆分为horizontally
,即Delete button above More button
。
如果您下载并运行代码,那么在SWUtilityButtonView.m
中您将看到以下代码:
- (void)setUtilityButtons:(NSArray *)utilityButtons{
if (!precedingView)
{
// First button; pin it to the left edge.
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[button]"
options:0L
metrics:nil
views:NSDictionaryOfVariableBindings(button)]];
}
else
{
// Subsequent button; pin it to the right edge of the preceding one, with equal width.
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[precedingView][button(==precedingView)]"
options:0L
metrics:nil
views:NSDictionaryOfVariableBindings(precedingView, button)]];
}
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[button]|"
options:0L
metrics:nil
views:NSDictionaryOfVariableBindings(button)]];
}
我应该对这些约束做出哪些修改,以使UIButtons
一个高于其他约束?