[英]Set UIImageVIew frame according to Image's Frame contain By UIImageView
I want to set the UIImage View Frame according to frame of Image which will show in UIImge View.I am using below code for that:-我想根据将在 UIImge 视图中显示的图像框架设置 UIImage 视图框架。我为此使用以下代码:-
[mainImageView.image drawInRect:CGRectMake(0, 0,mainImageView.image.frame.size.width,mainImageView.image.frame.size.height)];
But This Code Shown An Error.但是此代码显示错误。
A UIImage doesn't have a frame
property. UIImage 没有
frame
属性。 Try mainImageView.image.size.width
.试试
mainImageView.image.size.width
。 (I haven't tested this.) (我没有测试过这个。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.