Browse Source

1.处理pad OS 18系统tabbar 显示问题

Steven 5 months ago
parent
commit
7e02fe165d

+ 7 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/TabbarController/KSTabBarViewController.m

@@ -37,6 +37,13 @@
 }
 
 - (void)configItems {
+    // 处理 pad上 tabbar样式
+    if (@available(iOS 18.0, *)) {
+        if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
+        {
+            self.traitOverrides.horizontalSizeClass = UIUserInterfaceSizeClassCompact; //TAB BAR ON BOTTOM
+        }
+    }
     NSArray *controllerArray = @[@"HomeViewController",@"CourseViewController",@"ChatViewController",@"ShopMallViewController",@"MineViewController"];
     NSArray *titleArray = @[@"首页",@"课表",@"聊天",@"商城",@"我的"];
     NSArray *imageArray = @[@"tab_home_unselected",@"tab_course_unselected",@"tab_chat_unselected",@"tab_mall_unselected",@"tab_mine_unselected"];

+ 7 - 0
KulexiuForStudent/KulexiuForStudent/InstitutionModule/TabbarController/InstitutionTabBarController.m

@@ -43,6 +43,13 @@
 }
 
 - (void)configItems {
+    // 处理 pad上 tabbar样式
+    if (@available(iOS 18.0, *)) {
+        if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
+        {
+            self.traitOverrides.horizontalSizeClass = UIUserInterfaceSizeClassCompact; //TAB BAR ON BOTTOM
+        }
+    }
     NSArray *controllerArray = @[@"KSTenantHomeViewController",@"ChatViewController",@"InsititutionMineViewController"];
     NSArray *titleArray = @[@"首页",@"通讯",@"我的"];
     NSArray *imageArray = @[@"tenant_tab_home_unselected",@"tenant_tab_chat_unselected",@"tetant_tab_mine_unselected"];