Display viewController within tab view
I present a viewcontroller from a button pressed in a view that is within a tabbar view. The开发者_运维知识库 issue I am having is that the presented view covers the tabbar and the view fills the entire screen.
Even if I set its size to the size of the view minus the tab bar, the view still shows white in the area where the tabbar is.
How is this view presented so that it fits within the view of the tabbar screen?
Modal view controllers in an iphone will take up the entire screen. This can't be altered. Use navigation controllers for your job.
If you are using the tab bar controller, you can simply add the navigation controller in lieu of the current controller and make the current controller its root view controller. The frame sizes and view changes on tab selection are automatically handled the tab bar controller.
If you are using tab bar and are manually swapping stuff, you will need to set the navigation controllers view like you were trying to set the modal view controller above. This should solve this problem.
精彩评论