【发布时间】:2013-11-18 11:00:00
【问题描述】:
我有数百张 pdf 格式的图像可在我的应用程序中使用。我正在使用 UIImage-PDF(https://github.com/mindbrix/UIImage-PDF) 类别在我的应用程序中将 pdf 显示为图像。我正在使用此代码
imageView = [[ UIImageView alloc ] initWithFrame:CGRectMake(100, 200, 100, 100)];
创建一个 imageView,然后像这样添加图像
[imageView setImage:[ UIImage imageWithPDFNamed:[NSString stringWithFormat:@"%@.pdf",imageName] atSize:CGSizeMake( 100, 100) ]];
它适用于方形图像,问题是宽度大于高度时。图像缩小。 我想要的是,它应该根据高度调整图像的宽度。 我该怎么做?
【问题讨论】:
标签: iphone objective-c uiimageview ios7 uiimage