【发布时间】:2013-08-27 08:08:21
【问题描述】:
我有一个根视图控制器,我需要知道如何将其蓝色背景更改为图像或更改其颜色,并且还想在其右侧添加图像。 例如在下图中,我需要将文本根视图控制器的背景更改为另一个图像或更改其颜色并在根视图控制器文本的右侧添加一个小图标。我应该怎么做?我已经通过Change Navigation bar Background image on each navigation,但仍然无法实现它。
AppDelegate.h
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
Viewcontroller.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
【问题讨论】:
-
你试过了吗? [[UINavigationBar 外观]setBackgroundImage:@"navImage" forBarMetrics:UIBarMetricsDefault];
-
假设您在 iOS 5+ 上工作?
-
我正在使用 xcode 4.2 需要尽快升级:P
标签: iphone ios objective-c xcode navigationcontroller