开发者

how to add UItabBarController as a subview

I have made a TabBar project using xcode's templates and I have the tabbar in the mainwindow.xib ofcourse.

once after the user logs into the app, I redirect them to a page called notifications, [self presentModalViewController:controller animated:YES]; but the tabbar doesnt show up.

now how can I either include the tabbar 开发者_StackOverflow社区in the code above or get the tabbar from mainWindow.xib and display it once the UIView is loaded?

Thanks


Does your 'log in' view display the TabBar? If so, that's because your 'log in' view controller is a child of the TabBar view controller. Your modal view does not show the TabBar because it's controller is not a child of the TabBar view controller.

You may want to reconsider the design of you app. A modal view controller is usually presented as temporary deviation from the main workflow. See the View Controller Programming Guide for iOS - Modal View Controllers

You could swap things around. Have the main contents of your app in the TabBar, and upon the app launch, if the user is not already logged in, present your 'log in' view as a Modal View. Then dismiss it once the user logs in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜