开发者

Navigation bar resetting its frame

开发者 https://www.devze.com 2023-01-05 03:44 出处:网络
I have a TabBar which has been created programmatically. In the view controllers of this tab bar I am trying to reduce the size of navigation bar using -

I have a TabBar which has been created programmatically. In the view controllers of this tab bar I am trying to reduce the size of navigation bar using - "self.navigationController.navigationBar.frame = CGRectMake(0, 20, 320, 30);"

For 开发者_运维百科the first time the view controller loads the navigation bar is displayed with the dimensions specified by me, but after that it automatically resets its dimensions.

An example having this issue can be downloaded from http://dl.dropbox.com/u/2647092/iPhone_tabbar_example.zip To replicate this issue in this example follow these steps -

  1. open and run the project
  2. in the simulator click on Tab1 then click on Tab2 again click on Tab1 the Navigation bar of Tab1 would be resized to its default dimension

Is there any thing wrong I am doing in this case or is there an alternative method to do this?

Please let me know.

Thanks, Yogesh


Got the solution to this problem...instead of resizing the navigation bar in viewWillAppear resize it in the viewDidAppear

0

精彩评论

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

关注公众号