调整cell.UIImageView.image [英] resize cell.UIImageView.image

查看:86
本文介绍了调整cell.UIImageView.image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有不同大小的不同图像,我想把它放在每个单元格的cell.imageView.image中,但我想在每个单元格中制作相同的大小,尽管图像有不同的大小,我写这个我的代码:

i have the different image with the different size too, i want to put it in cell.imageView.image in every cell, but i want make same size in every cell although the image have the different size, i write this on my code :

UIImage *image = [UIImage imageNamed:imageName];
    cell.imageView.image = image;
    cell.imageView.layer.masksToBounds = YES;
    cell.imageView.layer.cornerRadius = 5.0;

    float sw=image.size.width/cell.imageView.image.size.width;
    float sh=image.size.height/cell.imageView.image.size.height;
    cell.imageView.transform=CGAffineTransformMakeScale(sw, sh);

但它不起作用,我确定没错..
任何身体可以帮助我。?

but it doesn't work, i'am sure that's right.. any body can help me.??

推荐答案

如果您的单元格是内置单元格,则假定单元格将所有图像的大小调整为固定的默认大小。你也可以发布你的申请截图吗?

If your cell is a built in cell, it is supposed that the cell will resize all the images to a fixed, default size. Can you post an screenshot of your application as well?

这篇关于调整cell.UIImageView.image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆