IOS 修改UITableview排序默认图标

来源:互联网 发布:c语言指向函数的指针 编辑:程序博客网 时间:2024/06/05 11:40

排序的控制是一个UITableViewCellReorderControl,但它是一个私有的类,不能直接访问它,通过子视图的层次结构找到它的图片。在自定义cell里添加如下方法:

- (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: @"new.png"];                    }                }            }        }    }   }




原创粉丝点击