diff --git a/QMUIConfigurationTemplate/QMUIConfigurationTemplate.m b/QMUIConfigurationTemplate/QMUIConfigurationTemplate.m index f3ac4075..11d545ba 100644 --- a/QMUIConfigurationTemplate/QMUIConfigurationTemplate.m +++ b/QMUIConfigurationTemplate/QMUIConfigurationTemplate.m @@ -226,7 +226,7 @@ - (void)applyConfigurationTemplate { QMUICMI.automaticCustomNavigationBarTransitionStyle = NO; // AutomaticCustomNavigationBarTransitionStyle : 界面 push/pop 时是否要自动根据两个界面的 barTintColor/backgroundImage/shadowImage 的样式差异来决定是否使用自定义的导航栏效果 QMUICMI.supportedOrientationMask = UIInterfaceOrientationMaskAll; // SupportedOrientationMask : 默认支持的横竖屏方向 QMUICMI.automaticallyRotateDeviceOrientation = NO; // AutomaticallyRotateDeviceOrientation : 是否在界面切换或 viewController.supportedOrientationMask 发生变化时自动旋转屏幕 - QMUICMI.statusbarStyleLightInitially = NO; // StatusbarStyleLightInitially : 默认的状态栏内容是否使用白色,默认为 NO,也即黑色 + QMUICMI.statusbarStyleLightInitially = NO; // StatusbarStyleLightInitially : 默认的状态栏内容是否使用白色,默认为 NO,在 iOS 13 下会自动根据是否 Dark Mode 而切换样式,iOS 12 及以前则为黑色 QMUICMI.needsBackBarButtonItemTitle = NO; // NeedsBackBarButtonItemTitle : 全局是否需要返回按钮的 title,不需要则只显示一个返回image QMUICMI.hidesBottomBarWhenPushedInitially = NO; // HidesBottomBarWhenPushedInitially : QMUICommonViewController.hidesBottomBarWhenPushed 的初始值,默认为 NO,以保持与系统默认值一致,但通常建议改为 YES,因为一般只有 tabBar 首页那几个界面要求为 NO QMUICMI.preventConcurrentNavigationControllerTransitions = YES; // PreventConcurrentNavigationControllerTransitions : 自动保护 QMUINavigationController 在上一次 push/pop 尚未结束的时候就进行下一次 push/pop 的行为,避免产生 crash diff --git a/QMUIKit/QMUIComponents/QMUIAlertController.h b/QMUIKit/QMUIComponents/QMUIAlertController.h index 2253d6d9..7548a8bb 100644 --- a/QMUIKit/QMUIComponents/QMUIAlertController.h +++ b/QMUIKit/QMUIComponents/QMUIAlertController.h @@ -204,8 +204,8 @@ typedef NS_ENUM(NSInteger, QMUIAlertControllerStyle) { /// sheet头部title和message之间的间距,默认8pt @property(nonatomic, assign) CGFloat sheetTitleMessageSpacing UI_APPEARANCE_SELECTOR; -/// sheet 的列数,一行显示多少个 item,默认是 1。 -@property(nonatomic, assign) CGFloat sheetColumnCount UI_APPEARANCE_SELECTOR; +/// sheet 的列数,一行显示多少个 button,默认是 1。 +@property(nonatomic, assign) CGFloat sheetButtonColumnCount UI_APPEARANCE_SELECTOR; /// 默认初始化方法 - (nonnull instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message preferredStyle:(QMUIAlertControllerStyle)preferredStyle; diff --git a/QMUIKit/QMUIComponents/QMUIAlertController.m b/QMUIKit/QMUIComponents/QMUIAlertController.m index 1ecb2d06..82e263db 100644 --- a/QMUIKit/QMUIComponents/QMUIAlertController.m +++ b/QMUIKit/QMUIComponents/QMUIAlertController.m @@ -162,7 +162,7 @@ + (void)initAppearance { alertControllerAppearance.sheetButtonHighlightBackgroundColor = UIColorMake(232, 232, 232); alertControllerAppearance.sheetHeaderInsets = UIEdgeInsetsMake(16, 16, 16, 16); alertControllerAppearance.sheetTitleMessageSpacing = 8; - alertControllerAppearance.sheetColumnCount = 1; + alertControllerAppearance.sheetButtonColumnCount = 1; alertControllerAppearance.isExtendBottomLayout = NO; } @@ -681,13 +681,13 @@ - (void)viewDidLayoutSubviews { // 按钮的布局 self.buttonScrollView.frame = CGRectMake(0, contentOriginY, CGRectGetWidth(self.containerView.bounds), 0); NSArray *newOrderActions = [self orderedAlertActions:self.alertActions]; - if (self.sheetColumnCount > 1) { + if (self.sheetButtonColumnCount > 1) { // 如果是多列,则为了布局,补齐 item 个数 NSMutableArray *fixedActions = [newOrderActions mutableCopy]; [fixedActions removeObject:self.cancelAction]; - if (fmodf(fixedActions.count, self.sheetColumnCount) != 0) { - NSInteger increment = self.sheetColumnCount - fmodf(fixedActions.count, self.sheetColumnCount); + if (fmodf(fixedActions.count, self.sheetButtonColumnCount) != 0) { + NSInteger increment = self.sheetButtonColumnCount - fmodf(fixedActions.count, self.sheetButtonColumnCount); for (NSInteger i = 0; i < increment; i++) { QMUIAlertAction *action = [[QMUIAlertAction alloc] init]; action.title = @""; @@ -702,7 +702,7 @@ - (void)viewDidLayoutSubviews { } } - CGFloat columnCount = self.sheetColumnCount; + CGFloat columnCount = self.sheetButtonColumnCount; CGFloat alertActionsWidth = CGRectGetWidth(self.buttonScrollView.bounds) / columnCount; CGFloat alertActionsLayoutX = 0; CGFloat alertActionsLayoutY = 0; diff --git a/QMUIKit/QMUICore/QMUIConfigurationMacros.h b/QMUIKit/QMUICore/QMUIConfigurationMacros.h index 88e48216..6f1a542c 100644 --- a/QMUIKit/QMUICore/QMUIConfigurationMacros.h +++ b/QMUIKit/QMUICore/QMUIConfigurationMacros.h @@ -238,7 +238,7 @@ #define AutomaticCustomNavigationBarTransitionStyle [QMUICMI automaticCustomNavigationBarTransitionStyle] // 界面 push/pop 时是否要自动根据两个界面的 barTintColor/backgroundImage/shadowImage 的样式差异来决定是否使用自定义的导航栏效果 #define SupportedOrientationMask [QMUICMI supportedOrientationMask] // 默认支持的横竖屏方向 #define AutomaticallyRotateDeviceOrientation [QMUICMI automaticallyRotateDeviceOrientation] // 是否在界面切换或 viewController.supportedOrientationMask 发生变化时自动旋转屏幕,默认为 NO -#define StatusbarStyleLightInitially [QMUICMI statusbarStyleLightInitially] // 默认的状态栏内容是否使用白色,默认为NO,也即黑色 +#define StatusbarStyleLightInitially [QMUICMI statusbarStyleLightInitially] // 默认的状态栏内容是否使用白色,默认为 NO,在 iOS 13 下会自动根据是否 Dark Mode 而切换样式,iOS 12 及以前则为黑色 #define NeedsBackBarButtonItemTitle [QMUICMI needsBackBarButtonItemTitle] // 全局是否需要返回按钮的title,不需要则只显示一个返回image #define HidesBottomBarWhenPushedInitially [QMUICMI hidesBottomBarWhenPushedInitially] // QMUICommonViewController.hidesBottomBarWhenPushed 的初始值,默认为 NO,以保持与系统默认值一致,但通常建议改为 YES,因为一般只有 tabBar 首页那几个界面要求为 NO #define PreventConcurrentNavigationControllerTransitions [QMUICMI preventConcurrentNavigationControllerTransitions] // PreventConcurrentNavigationControllerTransitions : 自动保护 QMUINavigationController 在上一次 push/pop 尚未结束的时候就进行下一次 push/pop 的行为,避免产生 crash diff --git a/QMUIKit/QMUIMainFrame/QMUICommonViewController.m b/QMUIKit/QMUIMainFrame/QMUICommonViewController.m index ef43f005..89308363 100644 --- a/QMUIKit/QMUIMainFrame/QMUICommonViewController.m +++ b/QMUIKit/QMUIMainFrame/QMUICommonViewController.m @@ -62,16 +62,18 @@ - (void)didInitialize { self.titleView.title = self.title;// 从 storyboard 初始化的话,可能带有 self.title 的值 self.navigationItem.titleView = self.titleView; - self.hidesBottomBarWhenPushed = HidesBottomBarWhenPushedInitially; - // 不管navigationBar的backgroundImage如何设置,都让布局撑到屏幕顶部,方便布局的统一 self.extendedLayoutIncludesOpaqueBars = YES; self.supportedOrientationMask = SupportedOrientationMask; - self.qmui_preferredStatusBarStyleBlock = ^UIStatusBarStyle{ - return StatusbarStyleLightInitially ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault; - }; + if (QMUICMIActivated) { + self.hidesBottomBarWhenPushed = HidesBottomBarWhenPushedInitially; + self.qmui_preferredStatusBarStyleBlock = ^UIStatusBarStyle{ + return StatusbarStyleLightInitially ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault; + }; + } + if (@available(iOS 11.0, *)) { self.qmui_prefersHomeIndicatorAutoHiddenBlock = ^BOOL{ return NO;