UITabBar appears 20 pixels down?

老子叫甜甜 提交于 2019-12-12 06:15:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!