开发者

Navigation based app with tabbar shows weird behaviour

开发者 https://www.devze.com 2023-01-29 09:55 出处:网络
I am developing an iPhone app which is a Navigation based app. In this app i need a tab bar, like the Twitter for iPhone app. So i followed this tutorial and code on how to set up a tab bar in an navi

I am developing an iPhone app which is a Navigation based app. In this app i need a tab bar, like the Twitter for iPhone app. So i followed this tutorial and code on how to set up a tab bar in an navigation based application. Works fine when I want to show an normal UIView at first, but when i want to show a TableView first, it shows a whitespace that is 40 to 50 pixels high above the tab bar. The whitespace actually comes from the tab bar, since i made the UIView backgroundcolor yellow in IB, and then the whitespace turns yellow.

Weird thing is, when i show a normal view in the first tabbar item, and then press the second tabbar item, the tableview loads fine, but when i want to present the table view first (which is what i want), it shows the whitespace. From what it seems, the whitespace is exactly the h开发者_运维问答eight of the navigationbar, but I don't know if it is related.

The tableview is shown via a normal UIView, because the customtabviewcontroller presents the appropriate view via an array of UIViews.

The example app from the tutorial shows exactly the same behaviour..

Does anyone has any idea how it is possible that it shows the whitespace?

Tnx in advance!


Did you 'drag' the tabbar on the view? Sometimes it doesn't snap the right way.


Okay, the answer was so simple, that i didn't expect it to work, and i don't really understand why it does. The answer is, make the table view 40px higher. It looks just fine now.

I dont know why, but a normal UIView object is 369px high, and the UITableView is 409px. Can anyone explain that to me?

0

精彩评论

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