navigation bar , status bar 透明

- (void)viewDidLoad {

    [super viewDidLoad];

    self.title = @"扫描设备二维码";

    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setShadowImage:[UIImage new]];

    self.navigationController.navigationBar.translucent = true;


}


- (void)viewWillDisappear:(BOOL)animated {

    [super viewWillDisappear:animated];

    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setShadowImage:nil];

}

你可能感兴趣的:(navigation bar , status bar 透明)