Separate XIB for UITabBarController?
Imported from the Apple Support Forums via the Wayback Machine 🔗
I want to add a UITabBarController view to my window, after it has been running for a while (when a user pushes a button in my game). Adding a UITabBarController to the same xib as the window dwells in is easy. The thing is that I don't want an instance of the tab bar until the user pushes the button (mostly because I don't know what data the tab bar controllers should have until the user pushes that button).
So I thought that maybe I could use a separate xib for the UITabBarController (preferably I want to use xib instead of code), that I can instantiate in code when the time comes. This proved to be a lot harder than I thought. I've tried making the File Owner of the XIB to a UITabBarController, and then add a tabbar and controllers, but it doesn't look like Xcode puts these things together automatically as when you add a UITabBarController explicitly from the library. So then I tried making the file owner to an UIViewController instead, add a UITabBarController, and then add that controller's view to the UIViewController's view. This kinda worked. It is easy to customize (which is why I want to use XIBs), but unfortunately, the tab bar's buttons don't work to 100%. Only the upper 50% of the buttons are tappable. Beneath, nothing happens if you tap, which isn't acceptable. Is this a bug? Or are you not allowed to add UITabBarControllers to subviews of window?
Any ideas how I can achieve what I want, preferably using XIBs?
You can see the "bug" here:
http://dl.getdropbox.com/u/608462/TabBarTest.zip
3 replies
Sign in or join Beachball Help to reply.
- 0
- 0
- 0