美文网首页iOS Developer
cell.imageView 固定尺寸

cell.imageView 固定尺寸

作者: 旺仔爸 | 来源:发表于2016-01-27 12:20 被阅读141次

    写在cell 返回之前

    
    CGSize itemSize = CGSizeMake(80, 50);
        UIGraphicsBeginImageContextWithOptions(itemSize, NO, UIScreen.mainScreen.scale);
        CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
        [cell.imageView.image drawInRect:imageRect];
        cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
    
    

    相关文章

      网友评论

        本文标题:cell.imageView 固定尺寸

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