我想处理单元格内的滑动事件,以便设置删除按钮的 alpha 值逐渐增加。
我想要这样:
如图所示,在左侧滑动单元格时,编辑按钮的 alpha 会增加。最后它被设置为 1.0。 如何使用默认的红色删除按钮在滑动时增加 alpha? 注意:我已经关注了 Bradens' answer处理 iOS 6/7 单元格内的删除按钮。
最佳答案
尝试使用SWTableViewCell ,并尝试在用户滑动时更改 alpha 值。
- (NSArray *)rightButtons
{
NSMutableArray *rightUtilityButtons = [NSMutableArray new];
[rightUtilityButtons sw_addUtilityButtonWithColor:
[UIColor colorWithRed:0.78f green:0.78f blue:0.8f alpha:1.0]
title:@"More"];
[rightUtilityButtons sw_addUtilityButtonWithColor:
[UIColor colorWithRed:1.0f green:0.231f blue:0.188 alpha:1.0f]
title:@"Delete"];
return rightUtilityButtons;
}
我的猜测是从
设置和重置 alpha- (void)swipeableTableViewCell:(SWTableViewCell *)cell scrollingToState:(SWCellState)state
P.S,我之前没有尝试过这个库。
关于ios - 向左滑动时如何处理 UITableViewCell 删除按钮动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25836031/