UINavigationBar autoresizing

前端 未结 8 2038
忘了有多久
忘了有多久 2020-12-08 11:39

In my app, I got a UINavigationController. Unfortunately, when I rotate the device and the interface orientation changes, the UINavigationBar doesn\'t change its height. In

8条回答
  •  悲&欢浪女
    2020-12-08 12:32

    Similar to Joost's answer, but putting the method in willAnimateRotationToInterfaceOrientation has a better animation effect than willRotateToInterfaceOrientation. (There's no animation delay)

    - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
        [self.navigationBar sizeToFit];
    }
    

提交回复
热议问题