gpt4 book ai didi

ios - 使用 UITableViewCellDeleteConfirmationControl 知道当前单元格的 subview 是什么

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:43:02 25 4
gpt4 key购买 nike

这样使用 UITableViewCellDeleteConfirmationControl 可以吗:

- (void)layoutSubviews {
[super layoutSubviews];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.0f];

for (UIView *subview in self.subviews) {
if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"]) {
CGRect newFrame = subview.frame;
newFrame.origin.x = 200;
subview.frame = newFrame;
}
else if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellEditControl"]) {
CGRect newFrame = subview.frame;
newFrame.origin.x = 100;
subview.frame = newFrame;
}
else if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellReorderControl"]) {
CGRect newFrame = subview.frame;
newFrame.origin.x = 200;
subview.frame = newFrame;
}
}
[UIView commitAnimations];
}

即使 UITableViewCellDeleteConfirmationControl 不是公共(public)类?

最佳答案

由于您比较的是字符串相等性,因此您没有公开任何私有(private) API,因此应该有资格提交 AppStore。

我已经成功地在我自己的 App Store 中使用了这种相等性检查。

关于ios - 使用 UITableViewCellDeleteConfirmationControl 知道当前单元格的 subview 是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15251233/

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