【发布时间】:2016-08-29 16:41:53
【问题描述】:
我正在尝试将图像设置为导航栏的 ViewController, 在将其设置为未完全绘制到 NavigationBar 之后。 无法理解为什么会这样。
图片尺寸为90高宽750
可以告诉我我需要做什么吗?
[self.navigationController setToolbarHidden:YES animated:NO];
self.title = NSLocalizedString(@"Dashboar", @"Dashboard");
self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
UIImage *currentImage = [[UIImage imageNamed:@"bg.png"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0) resizingMode:UIImageResizingModeStretch];
[self.navigationController.navigationBar setBackgroundImage:currentImage forBarMetrics:UIBarMetricsDefault];
【问题讨论】:
-
如果改变导航栏的半透明属性会改变什么吗?
-
@TejaNandamuri 谢谢,它启用我让它禁用它的工作。
标签: ios objective-c uiviewcontroller uinavigationcontroller