@interface BIDMyClass()
@end
@implementation BIDMyClass {
UINavigationBar *settingsBar;
}
-(void)loadView {
[super loadView];
settingsBar = [[UINavigationBar alloc] init];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[settingsBar setFrame:CGRectMake(0.0f, 0.0f, 293.0f, 44.0f)];
[settingsBar.topItem setTitle:@"Settings"];
[self.view addSubview:settingsBar];
}
settingsBar
添加但它没有标题。我该如何解决它?
您的视图控制器是否在UINavigationController中? – 2012-08-06 14:45:40
是的。但它必须是独立的UINavigationBar – RomanHouse 2012-08-06 14:49:34