自定义tableView编辑样式的图标

来源:互联网 发布:烤漆哑铃知乎 编辑:程序博客网 时间:2024/05/16 11:52

美工嫌弃tableView编辑样式的三横图片不好看,想要用自己的。

在自定义的tableViewCell中覆写下面的方法就可以了。

#pragma mark - 自定义设置行移动的图片

- (void) setEditing:(BOOL)editing animated:(BOOL)animated

{

    [supersetEditing: editinganimated: YES];

   

   if (editing) {

       for (UIView * viewin self.subviews)

       {

           if ([NSStringFromClass([viewclass])rangeOfString:@"Reorder"].location !=NSNotFound)

           {

               for (UIView * subviewin view.subviews)

               {

                  if ([subviewisKindOfClass: [UIImageViewclass]])

                   {

                       ((UIImageView *)subview).image = [UIImageimageNamed:@"icon_movement"]; // 自定义的图片名称

                   }

               }

           }

       }

   }

}

0 0
原创粉丝点击