Changing bounds of imageView of UITableViewCell

前端 未结 5 842

I\'m trying to place various size images inside imageView of UITableViewCell. I get the image data asynch\'ly, create the image, set the content mode of imageView and finall

5条回答
  •  孤街浪徒
    2020-12-13 16:45

    Create subclass of UITableViewCell:

    @interface UITableViewCellSubClass : UITableViewCell
    
    @end
    
    @implementation UITableViewCellSubClass
    
    - (void)layoutSubviews {
        [super layoutSubviews];
        self.imageView.frame = CGRectMake(0,4,32,32);
        self.textLabel.frame = CGRectMake(42,4,300,32);
    }
    @end
    

提交回复
热议问题