gpt4 book ai didi

ios - 设置在 UITableViewCell 中滑动时出现的删除按钮的高度

转载 作者:可可西里 更新时间:2023-11-01 06:20:42 25 4
gpt4 key购买 nike

enter image description here我有如下图所示的 UITableViewCell

单元格占用删除占用的高度。设置单元格高度以保持两个单元格之间的间距。

现在,当我滑动并出现删除按钮时(红色),它占据了如上图所示的单元格高度。我只是想将其高度设置为仅白色部分的高度或说灰色按钮的高度。谁能帮我设置在 UITableViewCell 中滑动后出现的删除按钮的高度?

最佳答案

解决这个问题的最好方法是重写

-(void)layoutSubviews in YourCustomCell:UITableViewCell    

然后

if ([NSStringFromClass([subview class])isEqualToString:@"UITableViewCellDeleteConfirmationControl"]){
UIView *deleteButtonView = (UIView *)[subview.subviews objectAtIndex:0];
CGRect buttonFrame = deleteButtonView.frame;
buttonFrame.origin.x = Xvalue;
buttonFrame.origin.y = Yvalue;
buttonFrame.size.width = Width;
buttonFrame.size.height = Height;
deleteButtonView.frame = buttonFrame;

}

关于ios - 设置在 UITableViewCell 中滑动时出现的删除按钮的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24502445/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com