Commit c045bb8e authored by light_bo's avatar light_bo

兼容应用全局隐藏状态栏的情况

parent d12a1e54
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
<array> <array>
<string>armv7</string> <string>armv7</string>
</array> </array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
......
...@@ -98,7 +98,10 @@ ...@@ -98,7 +98,10 @@
- (void)signleTapAction { - (void)signleTapAction {
_toolBar.hidden = !_toolBar.isHidden; _toolBar.hidden = !_toolBar.isHidden;
[self.navigationController setNavigationBarHidden:_toolBar.isHidden]; [self.navigationController setNavigationBarHidden:_toolBar.isHidden];
if (!TZ_isGlobalHideStatusBar) {
if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = _toolBar.isHidden; if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = _toolBar.isHidden;
}
} }
- (void)doneButtonClick { - (void)doneButtonClick {
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f) #define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f)
#define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f) #define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f)
#define TZ_isGlobalHideStatusBar [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIStatusBarHidden"] boolValue]
@protocol TZImagePickerControllerDelegate; @protocol TZImagePickerControllerDelegate;
@interface TZImagePickerController : UINavigationController @interface TZImagePickerController : UINavigationController
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
self.navigationBar.translucent = YES; self.navigationBar.translucent = YES;
[TZImageManager manager].shouldFixOrientation = NO; [TZImageManager manager].shouldFixOrientation = NO;
// Default appearance, you can reset these after this method // Default appearance, you can reset these after this method
// 默认的外观,你可以在这个方法后重置 // 默认的外观,你可以在这个方法后重置
self.oKButtonTitleColorNormal = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0]; self.oKButtonTitleColorNormal = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0];
......
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES]; [self.navigationController setNavigationBarHidden:YES animated:YES];
if (!TZ_isGlobalHideStatusBar) {
if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES; if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES;
}
if (_currentIndex) [_collectionView setContentOffset:CGPointMake((self.view.tz_width + 20) * _currentIndex, 0) animated:NO]; if (_currentIndex) [_collectionView setContentOffset:CGPointMake((self.view.tz_width + 20) * _currentIndex, 0) animated:NO];
[self refreshNaviBarAndBottomBarState]; [self refreshNaviBarAndBottomBarState];
} }
...@@ -73,7 +75,9 @@ ...@@ -73,7 +75,9 @@
- (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES];
if (!TZ_isGlobalHideStatusBar) {
if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = NO; if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = NO;
}
[TZImageManager manager].shouldFixOrientation = NO; [TZImageManager manager].shouldFixOrientation = NO;
} }
......
...@@ -125,7 +125,9 @@ ...@@ -125,7 +125,9 @@
[self.navigationController setNavigationBarHidden:YES]; [self.navigationController setNavigationBarHidden:YES];
_toolBar.hidden = YES; _toolBar.hidden = YES;
[_playButton setImage:nil forState:UIControlStateNormal]; [_playButton setImage:nil forState:UIControlStateNormal];
if (!TZ_isGlobalHideStatusBar) {
if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES; if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES;
}
} else { } else {
[self pausePlayerAndShowNaviBar]; [self pausePlayerAndShowNaviBar];
} }
...@@ -163,7 +165,10 @@ ...@@ -163,7 +165,10 @@
_toolBar.hidden = NO; _toolBar.hidden = NO;
[self.navigationController setNavigationBarHidden:NO]; [self.navigationController setNavigationBarHidden:NO];
[_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay.png"] forState:UIControlStateNormal]; [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay.png"] forState:UIControlStateNormal];
if (!TZ_isGlobalHideStatusBar) {
if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = NO; if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = NO;
}
} }
- (void)dealloc { - (void)dealloc {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment