动画效果隐藏和显示statusBar
作者:
千_城 | 来源:发表于
2018-04-10 16:16 被阅读25次- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
_isHidden = !_isHidden;
[UIView animateWithDuration:0.5 animations:^{
[self setNeedsStatusBarAppearanceUpdate];
}];
}
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleLightContent;
}
// UIStatusBarAnimationFade: 慢慢变暗隐藏, UIStatusBarAnimationSlide: 向上滑动隐藏
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
return UIStatusBarAnimationSlide;
}
- (BOOL)prefersStatusBarHidden {
return _isHidden;
}
![](https://img.haomeiwen.com/i1879151/18efe5536b4aed8e.gif)
1.gif
本文标题:动画效果隐藏和显示statusBar
本文链接:https://www.haomeiwen.com/subject/yglnhftx.html
网友评论