2012-02-01 158 views

回答

0

您需要引用IMAG的W/H。 类似这样的:

UIImage * myImage = [UIImage imageNamed:@“myImageName.png”]; UIImageView * myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,myImage.size.width,myImage.size.height)];

我目前没有打开XCode,但语法应与此类似。

+0

我不想设定的UIImageView为UIImage的大小相同。我想要的是调整UIImage的大小,以便像Yelp应用那样在UIImageview上完美显示 – 2012-02-01 04:18:38

0

集的ImageView的内容模式UIViewContentModeScaleAspectFit