开发者

Resizing images on iPhone for UITableView image

开发者 https://www.devze.com 2022-12-13 03:54 出处:网络
I\'m using a sectioned TableView, and I want to show an image on the left side of the cell. If I pick one from the photo library (out of the example photos in开发者_如何学运维 simulator) and set it a

I'm using a sectioned TableView, and I want to show an image on the left side of the cell. If I pick one from the photo library (out of the example photos in开发者_如何学运维 simulator) and set it as UITableViewCell.imageView.image, it takes up the whole screen.

How can I resize the image so that it fits exactly into the cell's image view?

Thanks,

Yassin


This is basically the same question as How to scale a UIImageView proportionally ?, which has a good answer.

Add that category to your project and call it with the size of your view. I've used the code and it works well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号