From f53982aa03719dcb2c38ff0d52ff63553d8703ea Mon Sep 17 00:00:00 2001 From: Jia Song <593908937@qq.com> Date: Thu, 18 Mar 2021 11:02:11 +0800 Subject: [PATCH 1/5] Update QMUIToastView.m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 https://github.com/Tencent/QMUI_iOS/issues/1186 --- QMUIKit/QMUIComponents/ToastView/QMUIToastView.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m b/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m index 1e1cd6ee..6bc4e4ef 100644 --- a/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m +++ b/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m @@ -90,6 +90,13 @@ - (void)didMoveToSuperview { if (![kToastViews containsObject:self]) { [kToastViews addObject:self]; } + /// https://github.com/Tencent/QMUI_iOS/issues/1186 + self.translatesAutoresizingMaskIntoConstraints = NO; + NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeTop multiplier:1 constant:0]; + NSLayoutConstraint *leading = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeLeading multiplier:1 constant:0]; + NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeBottom multiplier:1 constant:0]; + NSLayoutConstraint *trailing = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeTrailing multiplier:1 constant:0]; + [self.superview addConstraints:@[top, leading, bottom, trailing]]; } else { // hide if ([kToastViews containsObject:self]) { @@ -143,7 +150,6 @@ - (void)setContentView:(UIView *)contentView { - (void)layoutSubviews { [super layoutSubviews]; - self.frame = self.parentView.bounds; self.maskView.frame = self.bounds; CGFloat contentWidth = CGRectGetWidth(self.parentView.bounds); From 8f4a6722dfa9c2160b1f3d7930ba3ef69534b491 Mon Sep 17 00:00:00 2001 From: Jia Song <593908937@qq.com> Date: Tue, 11 May 2021 18:57:32 +0800 Subject: [PATCH 2/5] Update QMUIToastView.m removeFromSuperViewWhenHide --- QMUIKit/QMUIComponents/ToastView/QMUIToastView.m | 1 - 1 file changed, 1 deletion(-) diff --git a/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m b/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m index 45a748ea..8f1324b0 100644 --- a/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m +++ b/QMUIKit/QMUIComponents/ToastView/QMUIToastView.m @@ -334,7 +334,6 @@ + (BOOL)hideAllToastInView:(UIView *)view animated:(BOOL)animated { BOOL result = NO; for (QMUIToastView *toastView in toastViews) { result = YES; - toastView.removeFromSuperViewWhenHide = YES; [toastView hideAnimated:animated]; } return result; From 90c3eb47ecd675fb71fd4e16db012646df2b139e Mon Sep 17 00:00:00 2001 From: Jia Song <593908937@qq.com> Date: Tue, 11 May 2021 18:58:26 +0800 Subject: [PATCH 3/5] Update UISearchBar+QMUI.m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 崩溃问题 --- QMUIKit/UIKitExtensions/UISearchBar+QMUI.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QMUIKit/UIKitExtensions/UISearchBar+QMUI.m b/QMUIKit/UIKitExtensions/UISearchBar+QMUI.m index b6d386d3..391d2e69 100644 --- a/QMUIKit/UIKitExtensions/UISearchBar+QMUI.m +++ b/QMUIKit/UIKitExtensions/UISearchBar+QMUI.m @@ -80,8 +80,8 @@ + (void)load { } else { searchBar = (UISearchBar *)selfObject.superview.superview; } - NSAssert(!searchBar || [searchBar isKindOfClass:UISearchBar.class], @"Can not find UISearchBar from cancelButton"); - if (searchBar.qmui_alwaysEnableCancelButton && !searchBar.qmui_searchController) { + + if ([searchBar isKindOfClass:UISearchBar.class] && searchBar.qmui_alwaysEnableCancelButton && !searchBar.qmui_searchController) { firstArgv = YES; } From c6319c467b13aeb0b37511a55f6d9d8fb6be2714 Mon Sep 17 00:00:00 2001 From: Jia Song <593908937@qq.com> Date: Tue, 29 Jun 2021 18:40:29 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=AA=E5=B1=8F?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E4=B8=8B=EF=BC=8C=E9=A6=96=E9=A1=B5UI?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/Tencent/QMUI_iOS/issues/1263 --- QMUIKit/QMUICore/QMUIHelper.m | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/QMUIKit/QMUICore/QMUIHelper.m b/QMUIKit/QMUICore/QMUIHelper.m index 24bed4f7..bedf19ab 100644 --- a/QMUIKit/QMUICore/QMUIHelper.m +++ b/QMUIKit/QMUICore/QMUIHelper.m @@ -24,6 +24,18 @@ #import #import +@interface _QMUIFixIssue1263ViewController : UIViewController + +@end + +@implementation _QMUIFixIssue1263ViewController + +- (BOOL)shouldAutorotate { + return NO; +} + +@end + const CGPoint QMUIBadgeInvalidateOffset = {-1000, -1000}; NSString *const kQMUIResourcesBundleName = @"QMUIResources"; @@ -482,7 +494,7 @@ + (BOOL)isNotchedScreen { UIWindow *window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; peripheryInsets = window.safeAreaInsets; if (peripheryInsets.bottom <= 0) { - UIViewController *viewController = [UIViewController new]; + _QMUIFixIssue1263ViewController *viewController = [_QMUIFixIssue1263ViewController new]; window.rootViewController = viewController; if (CGRectGetMinY(viewController.view.frame) > 20) { peripheryInsets.bottom = 1; From 4e6ccb8339d9af98d414de3ffae8852d8c7a9a80 Mon Sep 17 00:00:00 2001 From: Jia Song <593908937@qq.com> Date: Tue, 29 Jun 2021 19:22:24 +0800 Subject: [PATCH 5/5] Update QMUIHelper.m --- QMUIKit/QMUICore/QMUIHelper.m | 1 + 1 file changed, 1 insertion(+) diff --git a/QMUIKit/QMUICore/QMUIHelper.m b/QMUIKit/QMUICore/QMUIHelper.m index bedf19ab..b6a7526f 100644 --- a/QMUIKit/QMUICore/QMUIHelper.m +++ b/QMUIKit/QMUICore/QMUIHelper.m @@ -494,6 +494,7 @@ + (BOOL)isNotchedScreen { UIWindow *window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; peripheryInsets = window.safeAreaInsets; if (peripheryInsets.bottom <= 0) { + /// https://github.com/Tencent/QMUI_iOS/issues/1263 _QMUIFixIssue1263ViewController *viewController = [_QMUIFixIssue1263ViewController new]; window.rootViewController = viewController; if (CGRectGetMinY(viewController.view.frame) > 20) {