这个导航栏的背景是这张图片的顶部一部分(导航栏和背景图应该是一张图片,不是分开显示), 我需要怎么设置? 而且让文字能更好的显示在图片上面?
认证0级讲师
Thoughts - Set the background color to a transparent image - Set the lines under the navigation bar to be transparent images - Set status bar
(Hope to adopt) [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent]; self.bgImageView.backgroundColor=[UIColor redColor];
UIImage *image = [UIImage imageNamed:@"bg.png"]; [self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; [self.navigationController.navigationBar setShadowImage:image];
UIView *statusview=[[UIView alloc]initWithFrame:CGRectMake(0, -20, 320, 20)]; statusview.backgroundColor=[UIColor redColor]; [self.navigationController.navigationBar addSubview:statusview];
Thoughts
- Set the background color to a transparent image
- Set the lines under the navigation bar to be transparent images
- Set status bar
(Hope to adopt)
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];
self.bgImageView.backgroundColor=[UIColor redColor];
UIImage *image = [UIImage imageNamed:@"bg.png"];
[self.navigationController.navigationBar setBackgroundImage:image
forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:image];
UIView *statusview=[[UIView alloc]initWithFrame:CGRectMake(0, -20, 320, 20)];
statusview.backgroundColor=[UIColor redColor];
[self.navigationController.navigationBar addSubview:statusview];