2013-03-08 43 views

回答

0

您需要手動加載圖像。 UIImage'simageWithData:將從網站加載圖片。

在您的視圖控制器中爲ImageView添加一個IBOutlet。

@property (nonatomic) IBOutlet UIImageView* backgroundImageView; 

在你的故事板添加UIImageView了一切,把它分配給backgroundImageView出口。

在你viewDidLoad方法視圖控制器加:

NSString *ImageURL = @"YourURLHere"; 
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:ImageURL]]; 
self.backgroundImageView.image = [UIImage imageWithData:imageData]; 
+0

我是很新的Xcode的。你能告訴我怎樣才能得到圖像的網址,並將其設置爲我的應用程序的背景 – 2013-03-08 20:48:19