开发者

Custom uitoolbar gets partly hidden

开发者 https://www.devze.com 2022-12-24 04:37 出处:网络
I\'d like to add a custom UIToolbar to my UIViewController. In Interface Builder I add the uitoolbar at the top of my view, and it looks just fine. However, when I run the app in the Simulator it gets

I'd like to add a custom UIToolbar to my UIViewController. In Interface Builder I add the uitoolbar at the top of my view, and it looks just fine. However, when I run the app in the Simulator it gets hidden by the default iphone bar (this one with the clock, battery status,开发者_如何学编程 etc.).

Here you can see how it looks like:

example http://www.cs.put.poznan.pl/jjurkiewicz/private/uitoolbar_hidden.png

Any ideas?


Seems like you're adding your view at coordinates (0,0), the top left of the screen. The view is then getting drawn behind the status bar. Make sure to add the view in the right position, to place it below the status bar it should be at (0,20)


You shouldn't hide the status bar needlessly - so use the IB inspector on the window/view, and under "Simulated Interface Elements", set status bar to anything bar "None". This should be how a new view is created in IB.


You can always just hide your status bar with the "Status bar is initially hidden" property in your Info.plist

0

精彩评论

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