这个导航栏的背景是这张图片的顶部一部分(导航栏和背景图应该是一张图片,不是分开显示), 我需要怎么设置? 而且让文字能更好的显示在图片上面?
认证0级讲师
생각 - 배경색을 투명한 이미지로 설정 - 내비게이션 바 아래 줄을 투명한 이미지로 설정하세요 - 상태 표시줄 설정
(입양 희망) [[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];
생각
- 배경색을 투명한 이미지로 설정
- 내비게이션 바 아래 줄을 투명한 이미지로 설정하세요
- 상태 표시줄 설정
(입양 희망)
[[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];