0
我正在開發和iOS應用程序,包括位置,風景和肖像。用iOS5設置風景圖像到uinavegationBar
使用iOS5,我想設置一個背景圖像到一個自定義的UINavegationBar。
我用的是:
if([self.navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) {
[self.navBar setBackgroundImage:[UIImage imageNamed:@"TabBarContactsPort.png"] forBarMetrics:UIBarMetricsDefault];
[self.navBar setBackgroundImage:[UIImage imageNamed:@"TabBarContactsLand.png"] forBarMetrics:UIBarMetricsLandscapePhone];
}
我寫在viewDiLoad方法的代碼,它的作品確定爲肖像,但使用風景模式相同的圖像。
請幫助我和thaaanks。
UIBarMetricsLandscapePhone不起作用。如果我總是使用「forBarMetrics:UIBarMetricsDefault」,您的答案將有效。 – ValentiGoClimb 2012-04-08 20:05:52