我不明白這一點。在方法didFinishLaunchingWithOptions
上,當我設置self.window.rootViewController = <instance of LoginViewController>
時,它顯示爲滿意的登錄屏幕。但是當我將LoginViewController
添加到NavigationController
然後設置self.window.rootViewController = <instance of NavigationController>
時,登錄屏幕頂部的一部分被隱藏了?爲什麼當將NavigationViewController添加到NavigationController時隱藏了LoginViewController的一部分?
1
A
回答
0
的原因是,視圖的上部區域被覆蓋的導航欄,所以你可以用這個代碼
[[self navigationController] setNavigationBarHidden:YES animated:YES];
0
這是因爲它隱藏在默認情況下,導航控制器可以看到導航欄。爲確保導航欄隱藏在您的登錄屏幕中,您應該調用viewDidLoad()
方法登錄屏幕視圖控制器self.navigationController?.setNavigationBarHidden(true, animated: false)
+0
沒錯。感謝您的回答 :) –
相關問題
- 1. 將UIWebView添加到NavigationViewController
- 2. 將NavigationController添加到當前視圖
- 3. 隱藏LoginViewController或者解聘到parentView
- 4. 如何將navigationViewController添加到UIViewController?
- 5. 爲什麼圖像的一部分隱藏
- 6. 當隱藏中間div時,底部div爲什麼不上移?
- 7. 如何在將精靈從隱藏更改爲非隱藏時添加分數
- 8. 隱藏navigationcontroller迅速
- 9. QToolButton在添加到QToolBar後爲什麼不能隱藏?
- 10. ASP.NET:爲什麼事件沒有被添加到代碼隱藏?
- 11. 爲什麼將轉義字符添加到隱藏輸入的值
- 12. 隱藏UIBezierPath的一部分
- 13. 爲什麼UIToolBar在NavigationController中消失了?
- 14. 當「position:absolute」被添加到DIV時,DIV改變了它的行爲。爲什麼?
- 15. SwipeRefreshLayout隱藏了RecyclerView的上半部分?
- 16. 爲什麼grails會向表單添加一個隱藏的複選框 - 它對它做了什麼?
- 17. 爲什麼Gephi隱藏圖形上的大部分邊緣?
- 18. 爲什麼在我的RelativeLayout按鈕被部分隱藏?
- 19. 添加一個隱藏的UIITextField到MFMailComposeViewController
- 20. 將帶有NavigationController的ChildViewController添加到ContainerController
- 21. 爲什麼溢出:隱藏不隱藏?
- 22. 爲什麼隱藏時隱藏複選框的標籤?
- 23. 添加PK時隱藏的MySQL [InnoDB] PK會發生什麼?
- 24. 隱藏部分
- 25. 隱藏部分
- 26. 隱藏部分
- 27. 隱藏部分
- 28. 隱藏部分
- 29. CSS:爲什麼當我採取溢出時,這是破壞:隱藏了嗎?
- 30. 將隱藏參數添加到腳本
隱藏設置導航欄。頂部隱藏的部分是導航欄。 – Signare