Transitioning UINavigationBar colors?

后端 未结 3 639
名媛妹妹
名媛妹妹 2020-12-30 17:43

I\'m basically trying to duplicate the behavior of the iPod app on the iPhone, where when you select a song, the music player view slides in, and the navigation bar transiti

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 18:33

    You can animate the status bar style change to create an effect that's pretty close.

    - (void)viewWillAppear:(BOOL)animated {
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:animated];
        self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
    }
    

    As you've noticed the navigation bar style changes immediately, but the animated change to the status bar still provides the overall appearance of a transition.

提交回复
热议问题