我試圖探索UIImageView,所以我添加了一個圖像「Logo.jpg」到我的projet(我是新的iPad編程)這是LoadImageProject但我不能得到這個圖像加載到我的觀點?UIImageView將不會加載圖像
在我的界面生成器(LoadImageViweController.xib)我拖一個UIImageView,並添加它,然後把它連接到文件的所有者
我的代碼:
LoadImageViweController.h
{
IBOutlet UIImageView *image;
}
@property (nonatomic, retain) IBOutlet UIImageView *image;
@end
並在執行文件中LoadImageViweControll er.m我已將此添加到viewDidLoad中方法:
- (void)viewDidLoad
{
[super viewDidLoad];
//declare the Image
UIImage *logo = [UIImage imageNamed:@"Logo.jpg"];
// init the UIImageView with the logo image
[self.image initWithImage:logo];
}
當II運行II得到總是黑屏?爲什麼?謝謝。
感謝alexy13,我敢肯定,這是對我的項目加入 – iPadDevloperJr 2011-04-08 10:26:38
確定。你清理並運行了嗎? – alexy13 2011-04-08 10:27:16
當然,我做到了。 – iPadDevloperJr 2011-04-08 10:34:32