我的代码:
@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
已添加,但上面没有标题。我该如何解决?