开发者

how can i make my UIImage autoSizing

开发者 https://www.devze.com 2023-02-12 21:31 出处:网络
In a area of my UIView, i want display a UIImage, but the width and height of it are not determinate. I wan开发者_运维问答t the UIImage can be autosize to a determinate size.

In a area of my UIView, i want display a UIImage, but the width and height of it are not determinate. I wan开发者_运维问答t the UIImage can be autosize to a determinate size. thanks!!


Not a problem. If you want to adjust image view height and width according to view so use some thing like this,

float height=yourView.height;
float width=yourView.Width;

CGRect imageFrame=yourImageView.view.frame;

//set these values according to you
imageFrame.size.height=height-50;
imageFrame.size.width=width-50;

imageFrame.origin.x=20;
imageFrame.origin.y=40;

yourImageView.view.frame=imageFrame;
0

精彩评论

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