【发布时间】:2009-09-02 14:18:50
【问题描述】:
我在界面生成器中创建了一个大小正确的 UIImageView,并在类文件中连接了插座。如何阻止大 jpg 填满整个屏幕?我希望图像调整大小以适合我在 IB 中制作的框架。
- (void)viewDidLoad {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"wine" ofType:@"jpg"];
NSData* data = [NSData dataWithContentsOfFile:filePath];
if(data){
photo.image= [[UIImage alloc] initWithData:data];
}
[super viewDidLoad];
}
谢谢。
【问题讨论】:
标签: iphone cocoa-touch uiimageview