首页 > 代码库 > 导航右侧添加按钮、隐藏导航条和状态栏

导航右侧添加按钮、隐藏导航条和状态栏

1.添加导航右侧按钮

UIBarButtonItem *rightButton = [[UIBarButtonItem

alloc] initWithTitle:@"无所谓"style:UIBarButtonItemStyleDone target:self action:@selector(clickRightButton)];

[self.navigationItem

setRightBarButtonItem:rightButton];

2.隐藏导航条

navigationBarself.navigationController.navigationBarHidden =YES;

3.隐藏状态栏

[[UIApplication

sharedApplication]setStatusBarHidden:YESanimated:NO];

导航右侧添加按钮、隐藏导航条和状态栏