美文网首页
UITableViewCellReorderControl 改变

UITableViewCellReorderControl 改变

作者: Peter杰 | 来源:发表于2020-08-12 21:56 被阅读0次

方法一:改在Controller里面

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (self.tableView.editing)
    {
        for (UIView * view in cell.subviews)
        {
            if ([NSStringFromClass([view class]) rangeOfString: @"UITableViewCellReorderControl"].location != NSNotFound)
            {
                for (UIView * subview in view.subviews) {
                    if ([subview isKindOfClass: [UIImageView class]])
                    {
                        ((UIImageView *)subview).image = [UIImage imageNamed: @"accessory_next"];
                    }
                }
            }
        }
    }
}

方法二:改在UITableViewCell里面

  - (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"];
                    }
                }
            }
        }
    }   
}

相关文章

  • UITableViewCellReorderControl 改变

    方法一:改在Controller里面 方法二:改在UITableViewCell里面

  • UItableView an'n

    1.排序的控制是一个UITableViewCellReorderControl,但这是一个私有的类,所以你不能直接...

  • 改变改变改变

    生活中总会有太多的不如意,我一直想要自己更坚强,可是走了很多路却依然发现自己还是那样的懦弱。 1 无论是在家里与父...

  • 改变!改变?改变……

    改变确实是痛苦的一件事情。 那么多年的舒适区里,那么安逸。一下子再走到另一个区里,真的没有那么容易。 渴望着某一天...

  • 改变,改变,改变

    每一年都浑浑噩噩的过着日子,从没有想改变,现在都40多岁了还混成这个样子,什么时候才是个头啊?搞得自己每天心事重重...

  • 改变

    改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改变改...

  • 改变、改变、再改变

    ...

  • 改变、改变,再改变

    01范冰冰分手了?我们并不知道 宋慧乔离婚了?我们也不晓得 我们刚结束了一天 忙碌的工作,踏入午夜的,梦想时分。时...

  • 改变,改变

    间接性踌躇满志,持续性混吃等死。这就是我大学生活的真实写照。想要改变,又不能改变现状。想要更美好的明天,又安于现在...

  • 改变改变

    昨天在银基,狂骂了张振一下午。现在想想他根本就没有犯多大的错。

网友评论

      本文标题:UITableViewCellReorderControl 改变

      本文链接:https://www.haomeiwen.com/subject/qvhmdktx.html