background
을 UINavigationBar
으로 변경하려고합니다.Objective-C에서 UINavigationBar의 배경을 설정하는 방법은 무엇입니까?
는 이미 Images.xcassets
에 이미지를 넣어, 그리고 xib
파일 TableView
viewDidLoad
에서
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"bar-background.png"] forBarMetrics:UIBarMetricsDefault];
쓰기가
입니다.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
UIView* bview = [[UIView alloc] init];
bview.backgroundColor = [UIColor groupTableViewBackgroundColor];
//self.title = NSLocalizedString(@"WiFi Camera Viewer", nil) ;
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"bar-background.png"] forBarMetrics:UIBarMetricsDefault];
}
그러나 UINavigationBar
는 다음
같은 모든 이미지가 어떻게 목표 - C에서 UINavigationBar의 배경을 설정할 수 없었다?
내가 누락 되었습니까? 미리 감사드립니다.
"bar-background.png"라는 이미지가 있습니까? –