2012-10-08 83 views
2

在我的iphone應用程序中,我使用背景圖像bg.png(對於視網膜大小[email protected])。 我更新了xcode到4.5。現在我需要安排適合iPhone 5 - 4英寸顯示屏的用戶界面。由於框架高度將變成568,我需要修復我的背景也有高度568. 我在我的應用程序中添加了一個名爲[email protected]的圖像。但Iam沒有得到這個圖像的iPhone 6模擬器在Xcode。有什麼辦法可以得到這張圖片嗎?或者我該如何實現這一目標?ios 6:在iPhone 5中的背景imageview

+1

我想,這可能對你有所幫助: http://stackoverflow.com/questions/12532405/images-for-iphone-5-retina-display – Andrey

回答

1

嘗試此動態代碼....

self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg.png"]]; 

這產生了內存泄漏。要麼改變initWithPatternImage到colorWithPatternImage,或者您的UIColor對象分配給一個變量,並正確地釋放它:

UIColor *color = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg.png"]]; 
self.view.backgroundColor = color; 
[color release];