Change default icon for moving cells in UITableView

前端 未结 11 1591
面向向阳花
面向向阳花 2020-11-28 21:46

I need to change default icon for moving cells in UITableView.

This one:

\"enter

11条回答
  •  伪装坚强ぢ
    2020-11-28 22:05

    Updated solution of Ashley Mills (for iOS 7.x)

    if (editing) {
        UIView *scrollView = self.subviews[0];
        for (UIView * view in scrollView.subviews) {
            NSLog(@"Class: %@", NSStringFromClass([view class]));
            if ([NSStringFromClass([view class]) rangeOfString: @"Reorder"].location != NSNotFound) {
                for (UIView * subview in view.subviews) {
                    if ([subview isKindOfClass: [UIImageView class]]) {
                        ((UIImageView *)subview).image = [UIImage imageNamed: @"moveCellIcon"];
                    }
                }
            }
        }
    }
    

提交回复
热议问题