在我的iphone應用程序中,我使用背景圖像bg.png(對於視網膜大小[email protected])。 我更新了xcode到4.5。現在我需要安排適合iPhone 5 - 4英寸顯示屏的用戶界面。由於框架高度將變成568,我需要修復我的背景也有高度568. 我在我的應用程序中添加了一個名爲[email protected]的圖像。但Iam沒有得到這個圖像的iPhone 6模擬器在Xcode。有什麼辦法可以得到這張圖片嗎?或者我該如何實現這一目標?ios 6:在iPhone 5中的背景imageview
2
A
回答
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];
0
如何設置[email protected]爲背景圖片,並設置ImageView的比例來填充看點?
相關問題
- 1. iPhone 6的iOS背景圖像
- 2. XCode 5 ImageView在ios 6中消失
- 3. iOS 6中的UIGlassButton/iPhone 5不工作
- 4. iOS 6背景圖像
- 5. iPhone 5 - 背景圖像
- 6. 的TabBar背景顏色和IOS 5
- 7. 設置背景顏色在IOS 6
- 8. 與iPhone UINavigationBar的背景圖片6
- 9. 自定義UIButton背景圖像顯示在iOS 6但不是iOS 5
- 10. ImageView背景
- 11. ImageView背景行
- 12. 的Xcode 4.5背景圖片iPhone 4,4S,5
- 13. Xcode 3.2.6適用於iPhone iOS 5 beta 6?
- 14. 的iOS 5:renderInContext擦除背景
- 15. iOS設備大小的Autolay字體調整(iPhone 6 plus,iPhone 6,iPhone 5)
- 16. 核心文本背景色爲iOS 6
- 17. 設置Imageview背景
- 18. ImageView src與背景
- 19. 在ios 5中禁用MKMapView(iOS 6)
- 20. Imageview背景透明
- 21. UINavigationBar原始分辨率iPhone 6和6的背景圖像
- 22. ImageView的背景的onclick
- 23. UITabbar的背景圖像ios
- 24. iOS 5和iOS 6中的UITabbar差異
- 25. iOS 6和iOS 5中的TextAlignment
- 26. AvCam中的風景iOS 6
- 27. 在iOS中更改UINavigationBar的背景圖像<5
- 28. 在listView中更改ImageView背景onItemSelected Android
- 29. 如何在Android中設置ImageView背景
- 30. 爲Iphone 3g,Iphone 4s和Iphone 5設置背景圖像
我想,這可能對你有所幫助: http://stackoverflow.com/questions/12532405/images-for-iphone-5-retina-display – Andrey