how can i make my UIImage autoSizing
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;
精彩评论