【发布时间】:2012-09-09 15:57:01
【问题描述】:
对于自定义导航栏,我想设置背景图像并自定义左键和右键。所以我用不带 .xib 的代码实例化它。但导航栏上方有一个空白栏。
这是我的代码:
-(void) createNavBar:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
{
if (!navBar)
{
navBarController = [[[UINavigationController alloc] init] autorelease];
navBarController.navigationBar.bounds = CGRectMake(0, 0, 320, 40);
[navBarController.navigationBar setBackgroundImage:[UIImage imageNamed:@"www/images/header_bg@2x.png"] forBarMetrics:UIBarMetricsDefault];
[[[self webView] superview] addSubview: navBarController.navigationBar];
}
}
运行编译,发现导航栏上方有一个空白栏。 这是一个截图:
如何去掉标题栏和蓝色导航栏之间的空格键? 感谢您的指导。
【问题讨论】:
-
尝试只使用导航栏而不是navigationController..如果你不使用navicationController
-
它是运营商、时间和电池信息空间!
标签: iphone navigation space