我想讓我的RootView顯示在桌面上方的UIImage中。我怎麼能做到這一點?在RootView中的UIImageView
1
A
回答
0
您應該使用setBackgroundView方法。
一個小例子:
// my image
UIImage *image = [[[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"my_image" ofType:@"png"]] autorelease];
// an imageView to put the imagen on
UIImageView *imageView = [[[UIImageView alloc] initWithImage:image] autorelease];
// we set the background of the table with the imageView
[myTable setBackgroundView:imageView];
+0
autorelease沒有真正的需要,或者有嗎? backgroundView屬性由retain關鍵字定義,因此您可以在調用setBackgroundView之後保存釋放圖像和圖像視圖。 – hennes 2011-03-09 16:28:52
+0
準確地說,autorelease是沒有必要的。這只是我的許多習慣之一。對不起,如果它讓你迷惑了代碼的主要目的。 – 2011-03-09 16:33:31
相關問題
- 1. 如何在碎片中獲取rootview?
- 2. 獲取RootView的實例中的AppDelegate
- 3. Xamarin.Android中rootView的高度和寬度
- 4. 如何檢查我是否在tabbaritem中的viewcontroller的rootview?
- 5. 在UIImageView中的長寬比
- 6. 在分割視圖中更改Rootview(uitableviewcontroller子類)的位置
- 7. 當我在appdelegate中設置Tabbar時,如何設置viewcontroller的rootview?
- 8. iPad:在RootView中合併SplitViewController和NavigationController的概念?
- 9. 的UIImageView在ipad
- 10. 的UIImageView在iPhone
- 11. 中的UIImageView
- 12. 在UIImageView中重用UIImageView對象通過「setImageWithURL」獲取的UIImageView對象
- 13. 我有關於rootview掛起的問題
- 14. Android - 從URL添加到rootview的位圖
- 15. 在UIScrollView中集中UIImageView
- 16. 的UIImageView在另一
- 17. 圓角中的UIImageView
- 18. 在一個UIImageView中繪製一個UIImage在另一個UIImageView內
- 19. 在UIImageView的UIImage在Swift中移動UIView
- 20. 在沒有contentInset的UIScrollView中居中UIImageView?
- 21. 在數組中獲取uiimageview的中心
- 22. 在UIWebView中是否有UIImageView?
- 23. 在UIImageView UIScrollView中更改UIImage
- 24. 在UIImageView中旋轉圖像
- 25. 管理View Controller的Rootview控制器,如iPad中的子視圖
- 26. UiButton/IBAction - 從RootView到故事板中的mainView的鏈接
- 27. UIAlertView中使用的UIImageView在accessoryView的
- 28. 在TableView UIImageview
- 29. UIImageView在UIScrollView?
- 30. UIImageView在UIPopoverController前
你說的 「上面」 是什麼意思?你想把圖片放在表格視圖的開頭還是直接放在表格視圖的開頭? – hennes 2011-03-09 16:30:56