iOS 7 and later: set status bar style per view controller

前端 未结 10 725
旧巷少年郎
旧巷少年郎 2020-12-02 07:43


I tried many ways to set the status bar style (default or lightcontent) but can\'t get it to work on a per view controller basis. I can set the status bar style for the

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 08:00

    There is a catch here if your view controller is inside standalone UINavigationController and not a part of Storyboard based UINavigationController then above all methods fail. I came across this situation and then in order to set the status bar to light style i used following

    [self.navigationController.navigationBar setBarStyle:UIBarStyleBlack];
    

    This worked perfectly for me.

提交回复
热议问题