gpt4 book ai didi

iphone - 如何为 UITable 中的移动行制作自定义按钮和单元格阴影?

转载 作者:行者123 更新时间:2023-12-01 19:13:59 28 4
gpt4 key购买 nike

如何在 UITable 中制作用于移动行的自定义按钮?

我希望它是透明的。
(而不是这个:enter image description here)

另一件事是,当单元格移动时,它有阴影。是否可以删除它?

最佳答案

试试这个...

您必须通过继承 UITableViewCell 并覆盖其 setEditing:animated: 方法来做到这一点,如下所示:

重排序控件是一个 UITableViewCellReorderControl,但那是一个私有(private)类,所以你不能直接访问它。

您可以只查看 subview 的层次结构并找到它的 imageView。

- (void) setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing: editing animated: YES];

if (editing) {

for (UIView * view in self.subviews) {
if ([NSStringFromClass([view class]) rangeOfString: @"Reorder"].location != NSNotFound) {
for (UIView * subview in view.subviews) {
if ([subview isKindOfClass: [UIImageView class]]) {
((UIImageView *)subview).image = [UIImage imageNamed: @"yourimage.png"];
}
}
}
}
}
}

关于iphone - 如何为 UITable 中的移动行制作自定义按钮和单元格阴影?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14502815/

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