Mar*_*ark 5 iphone uinavigationbar
我已经看到它在一些应用程序上完成,其中导航栏实际上小于默认的44px,并且在导航栏上方有一个UIView(具有功能)...
我想要的不仅仅是自定义背景图片,我确实想知道该怎么做,但我不知道从哪里开始得到这样的东西.
非常感谢任何帮助:)马克
我找到了一种方法来做到这一点:
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 20.0f, 320.0f, 32.0f)];
UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
UIImageView *back = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"logo.png"]];
[back setFrame: CGRectMake(0, 0, 320, 20)];
[tempView addSubview: back];
[[self view] addSubview: tempView];
[[self view] addSubview: navBar];
UINavigationItem *navItem = [[UINavigationItem alloc] initWithTitle: @"Controls"];
[navBar pushNavigationItem:navItem animated:NO];
Run Code Online (Sandbox Code Playgroud)
这似乎可以解决问题,尽管我似乎无法弄清楚如何将其“放入”navigationController以便后退按钮起作用,目前我必须手动将 a 插入leftBarButtonItem到 navItem 中,后退按钮似乎永远不会显示。 ..
| 归档时间: |
|
| 查看次数: |
4803 次 |
| 最近记录: |