问题
I have created a UITabBarController and adding to a UIViewController subview.
My code is implemented programmatically.
The UITabBar is showed up 20pixels down the view.
UITabBarController *tabCtrl_obj = [[UITabBarController alloc]init];
[self.view addSubview:tabCtrl_obj.view];
How should i solve it?
回答1:
It's the status bar that's doing it. Sometimes if you add a view directly to the window it can behave oddly - generally it means you have to define more elements of the view yourself. Try reducing the size of your view by 20 pixels (probably to 460) and then removing the simulated status bar in interface builder. How much are you doing programmatically?
来源:https://stackoverflow.com/questions/5699404/uitabbar-appears-20-pixels-down