添加navbar以及上面的左右按钮代码
UINavigationBar *navBar = [[UINavigationBaralloc] initWithFrame:CGRectMake(0, 0, 824, 44)];
navBar.barStyle = UIBarStyleDefault;
UINavigationItem *navItem = [[UINavigationItemalloc] init];
navItem.leftItemsSupplementBackButton = YES;
navItem.title = @"Add CRA";
UIBarButtonItem *leftButton = [[UIBarButtonItemalloc] initWithTitle:@"Back"
style:UIBarButtonItemStylePlain
target:self
action:@selector(back)];
navItem.leftBarButtonItem = leftButton;
UIBarButtonItem *rightButton = [[UIBarButtonItemalloc] initWithTitle:@"Done"
style:UIBarButtonItemStylePlain
target:self
action:@selector(done)];
navItem.rightBarButtonItem = rightButton;
navBar.items = @[navItem];
[self.view addSubview:navBar];