Unverified Commit bc9d93ea authored by 谭真's avatar 谭真 Committed by GitHub

Merge pull request #1161 from RayJiang16/master

修复 iOS 13 新的 present 效果导致 UI 错误的问题
parents aa519070 836e6dc2
......@@ -21,6 +21,7 @@
UIButton *_settingBtn;
BOOL _pushPhotoPickerVc;
BOOL _didPushPhotoPickerVc;
CGRect _cropRect;
UIButton *_progressHUD;
UIView *_HUDContainer;
......@@ -493,6 +494,18 @@
_cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, cropRect.origin.x, widthHeight, widthHeight);
}
- (CGRect)cropRect {
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
BOOL isFullScreen = self.view.tz_height == screenHeight;
if (isFullScreen) {
return _cropRect;
} else {
CGRect newCropRect = _cropRect;
newCropRect.origin.y -= ((screenHeight - self.view.tz_height) / 2);
return newCropRect;
}
}
- (void)setTimeout:(NSInteger)timeout {
_timeout = timeout;
if (timeout < 5) {
......@@ -782,9 +795,10 @@
CGFloat tableViewHeight = 0;
CGFloat naviBarHeight = self.navigationController.navigationBar.tz_height;
BOOL isStatusBarHidden = [UIApplication sharedApplication].isStatusBarHidden;
BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
if (self.navigationController.navigationBar.isTranslucent) {
top = naviBarHeight;
if (!isStatusBarHidden) top += [TZCommonTools tz_statusBarHeight];
if (!isStatusBarHidden && isFullScreen) top += [TZCommonTools tz_statusBarHeight];
tableViewHeight = self.view.tz_height - top;
} else {
tableViewHeight = self.view.tz_height;
......
......@@ -303,10 +303,11 @@ static CGFloat itemMargin = 5;
CGFloat collectionViewHeight = 0;
CGFloat naviBarHeight = self.navigationController.navigationBar.tz_height;
BOOL isStatusBarHidden = [UIApplication sharedApplication].isStatusBarHidden;
BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
CGFloat toolBarHeight = [TZCommonTools tz_isIPhoneX] ? 50 + (83 - 49) : 50;
if (self.navigationController.navigationBar.isTranslucent) {
top = naviBarHeight;
if (!isStatusBarHidden) top += [TZCommonTools tz_statusBarHeight];
if (!isStatusBarHidden && isFullScreen) top += [TZCommonTools tz_statusBarHeight];
collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - toolBarHeight - top : self.view.tz_height - top;;
} else {
collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - toolBarHeight : self.view.tz_height;
......
......@@ -247,8 +247,9 @@
[super viewDidLayoutSubviews];
TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController;
CGFloat statusBarHeight = [TZCommonTools tz_statusBarHeight];
CGFloat statusBarHeightInterval = statusBarHeight - 20;
BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
CGFloat statusBarHeight = isFullScreen ? [TZCommonTools tz_statusBarHeight] : 0;
CGFloat statusBarHeightInterval = isFullScreen ? (statusBarHeight - 20) : 0;
CGFloat naviBarHeight = statusBarHeight + _tzImagePickerVc.navigationBar.tz_height;
_naviBar.frame = CGRectMake(0, 0, self.view.tz_width, naviBarHeight);
_backButton.frame = CGRectMake(10, 10 + statusBarHeightInterval, 44, 44);
......
......@@ -140,7 +140,8 @@
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
CGFloat statusBarHeight = [TZCommonTools tz_statusBarHeight];
BOOL isFullScreen = self.view.tz_height == [UIScreen mainScreen].bounds.size.height;
CGFloat statusBarHeight = isFullScreen ? [TZCommonTools tz_statusBarHeight] : 0;
CGFloat statusBarAndNaviBarHeight = statusBarHeight + self.navigationController.navigationBar.tz_height;
_playerLayer.frame = self.view.bounds;
CGFloat toolBarHeight = [TZCommonTools tz_isIPhoneX] ? 44 + (83 - 49) : 44;
......
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