Change the height of NavigationBar and UIBarButtonItem elements inside it in Cocoa Touch

后端 未结 6 2092
忘了有多久
忘了有多久 2020-12-23 15:19

I suppose it\'s not strictly in line with Apple guidelines but I guess it must be possible somehow. I\'d like to change the height of navigation bar inside UINavigationContr

6条回答
  •  被撕碎了的回忆
    2020-12-23 15:40

    Maybe this tutorial about a customized navbar will help you: Recreating the iBooks wood themed navigation bar

    If you create a BarButtonItem with a UIImageView you can maybe change the framesize/boundsize of the custom UIImageView

    UIImageView* imageView = [[[UIImageView alloc] initWithFrame:navigationController.navigationBar.frame] autorelease];
    imageView.contentMode = UIViewContentModeLeft;
    imageView.image = [UIImage imageNamed:@"NavBar-iPhone.png"];
    [navigationController.navigationBar insertSubview:imageView atIndex:0];
    

    So for your need you would give the -initWithFrame method appropriate values.

提交回复
热议问题