Explorar el Código

针对 iphonex iphoneES iphone8p 3种机型进行UI适配 up

openlockPPP hace 1 año
padre
commit
c806f4f193

+ 1 - 1
JiaPeiManage/Sources/Main/Base/BaseViewController.swift

@@ -20,7 +20,7 @@ class BaseViewController: UIViewController, NetAnimationLoadable {
     }
     
     @IBOutlet weak var nav_top_layout: NSLayoutConstraint!
-    
+    @IBOutlet weak var nav_topH_layout: NSLayoutConstraint!
     // MARK: Properties
     lazy private(set) var className: String = {
         return type(of: self).description().components(separatedBy: ".").last ?? ""

+ 1 - 0
JiaPeiManage/Sources/Main/MainTabBarController.swift

@@ -72,6 +72,7 @@ final class MainTabBarController: UITabBarController, View {
     
     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
+        self.tabBar.barTintColor = .db_tbbg
         if #available(iOS 11.0, *) {
             self.tabBar.height = Metric.tabBarHeight + self.view.safeAreaInsets.bottom
         } else {

+ 2 - 2
JiaPeiManage/Sources/Modulars/Login/Controllers/LoginViewController.xib

@@ -41,7 +41,7 @@
                     <rect key="frame" x="15" y="296" width="345" height="380"/>
                     <subviews>
                         <button opaque="NO" clipsSubviews="YES" alpha="0.5" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QFo-KM-CGQ">
-                            <rect key="frame" x="28" y="290" width="289" height="45"/>
+                            <rect key="frame" x="28" y="285" width="289" height="45"/>
                             <color key="backgroundColor" red="0.20784313725490194" green="0.74901960784313726" blue="0.36862745098039218" alpha="1" colorSpace="calibratedRGB"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="45" id="KrL-UQ-pBh"/>
@@ -197,7 +197,7 @@
                         <constraint firstItem="U4y-em-jeM" firstAttribute="top" secondItem="wQT-0A-9II" secondAttribute="bottom" constant="20" id="6tm-wu-M0D"/>
                         <constraint firstAttribute="trailing" secondItem="QFo-KM-CGQ" secondAttribute="trailing" constant="28" id="78S-HW-eIZ"/>
                         <constraint firstItem="QFo-KM-CGQ" firstAttribute="leading" secondItem="SDO-oc-nvt" secondAttribute="leading" constant="28" id="7JJ-hu-aCk"/>
-                        <constraint firstAttribute="bottom" secondItem="QFo-KM-CGQ" secondAttribute="bottom" constant="45" id="8ek-3v-7Ow"/>
+                        <constraint firstAttribute="bottom" secondItem="QFo-KM-CGQ" secondAttribute="bottom" constant="50" id="8ek-3v-7Ow"/>
                         <constraint firstAttribute="trailing" secondItem="wQT-0A-9II" secondAttribute="trailing" constant="25" id="CKe-nz-ZmD"/>
                         <constraint firstItem="U4y-em-jeM" firstAttribute="leading" secondItem="SDO-oc-nvt" secondAttribute="leading" constant="25" id="MmG-0l-zbn"/>
                         <constraint firstItem="wQT-0A-9II" firstAttribute="top" secondItem="SDO-oc-nvt" secondAttribute="top" constant="40" id="MoJ-2j-zXc"/>

+ 1 - 1
JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsPageController.swift

@@ -107,7 +107,7 @@ final class StatisticsPageController: BaseGroupTableViewController {
             //计算相对坐标
             let headerFrameInSuperview = tableView.convert(CGPoint(x: 0, y: bottomY), to: tableView.superview)
             selectDateView.snp.remakeConstraints { make in
-                make.top.equalTo(headerFrameInSuperview.y-navBar.bottom)
+                make.top.equalTo(headerFrameInSuperview.y-navBar.bottom+(isIphoneX==true ? 20:0))
                 make.left.right.equalToSuperview()
                 make.height.equalTo(172.f)
             }

+ 8 - 2
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTabBarController.swift

@@ -19,7 +19,9 @@ final class MeTabBarController: UITabBarController, View {
     fileprivate struct Metric {
         static let tabBarHeight = 50.f
     }
-    
+    let bgView = UIView.init().then {
+        $0.backgroundColor = .db_tbbg
+    }
     // MARK: Properties
     
     var disposeBag = DisposeBag()
@@ -49,8 +51,12 @@ final class MeTabBarController: UITabBarController, View {
                                              for: .selected)
              }
          }
+         
+
+         self.tabBar.insertSubview(bgView, at: 0)
          self.selectedIndex = 1
          self.tabBar.barTintColor = .db_tbbg
+         self.tabBar.tintColor = UIColor("#30B05C")
     }
     
     required init?(coder aDecoder: NSCoder) {
@@ -77,7 +83,6 @@ final class MeTabBarController: UITabBarController, View {
             }).disposed(by: disposeBag)
     }
     
-    
     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
         if #available(iOS 11.0, *) {
@@ -85,6 +90,7 @@ final class MeTabBarController: UITabBarController, View {
         } else {
             self.tabBar.height = Metric.tabBarHeight
         }
+        self.bgView.frame = CGRect(x: 0, y: 0, width: Int(self.view.width), height: Int(self.tabBar.height))
         self.tabBar.bottom = self.view.height
     }
 }

+ 5 - 1
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeDetails/MeTraineeDetails03Controller.swift

@@ -94,7 +94,11 @@ final class MeTraineeDetails03Controller: BaseGroupTableViewController {
         tableView.separatorStyle = .none //去除分割线
         tableView.register(UINib(nibName: "MeTraineeDetails03Cell", bundle: nil), forCellReuseIdentifier: cellIdentifier)
         tableView.rowHeight = 92.f
-        tableView.contentInset = UIEdgeInsets(top: -25, left: 0, bottom: -25, right: 0)
+        if #available(iOS 13.0, *) {
+            tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        }else {
+            tableView.contentInset = UIEdgeInsets(top: -25, left: 0, bottom: -25, right: 0)
+        }
         setupRefreshHeader(tableView) {[unowned self] in
             self.getStuResultList()
         }

+ 1 - 0
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeDetailsPageViewController.swift

@@ -95,6 +95,7 @@ final class MeTraineeDetailsPageViewController: BaseViewController {
     
     // MARK: 私有方法
     func setupUI(){
+        if isIphoneX {self.nav_topH_layout.constant = 64.f+24.f}
         self.view.backgroundColor = .db_theme
         if LocalManager.userInfo.classType == 1 || LocalManager.userInfo.classType == 3{
             self.stupwd_showView.isHidden = true

+ 1 - 0
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeDetailsPageViewController.xib

@@ -11,6 +11,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MeTraineeDetailsPageViewController" customModule="JiaPeiManage" customModuleProvider="target">
             <connections>
                 <outlet property="header_view" destination="2ye-z8-GF5" id="2gD-Zu-WJu"/>
+                <outlet property="nav_topH_layout" destination="2TZ-Nd-Y4a" id="h9V-x4-ZsM"/>
                 <outlet property="sex_imageview" destination="Zqx-If-LXv" id="GMf-yY-bnK"/>
                 <outlet property="stupwd_hideView" destination="cb5-hL-bGP" id="cDX-vq-iOs"/>
                 <outlet property="stupwd_hidebutton" destination="rKO-7J-CVq" id="Tqk-o1-bOc"/>

+ 3 - 3
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeSearchPageViewController.swift

@@ -38,10 +38,10 @@ final class MeTraineeSearchPageViewController: BaseTableViewController {
     //重置约束
     override func setupConstraints() {
         self.tableView.snp.remakeConstraints { make in
-            make.top.equalTo(self.searchView.bottom)
+            make.top.equalTo(self.searchView.snp.bottom)
             make.left.right.bottom.equalTo(self.view)
         }
-        
+        self.loadViewIfNeeded()
     }
     
     override func viewDidLoad() {
@@ -53,7 +53,7 @@ final class MeTraineeSearchPageViewController: BaseTableViewController {
     
     // MARK: 私有方法
     func setupUI(){
-        if isIphoneX {self.nav_top_layout.constant = 24.f}
+        if isIphoneX {self.nav_topH_layout.constant = 64.f+24.f}
         self.view.backgroundColor = .db_theme
 //        self.searchView.addSubview(search_bar)
         self.search_textfield.placeholderColor = .db_place

+ 1 - 0
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeSearchPageViewController.xib

@@ -10,6 +10,7 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MeTraineeSearchPageViewController" customModule="JiaPeiManage" customModuleProvider="target">
             <connections>
+                <outlet property="nav_topH_layout" destination="v0k-Ys-7T4" id="xeP-fQ-u3m"/>
                 <outlet property="nav_top_layout" destination="tPC-jM-adA" id="Dfu-2v-8Cz"/>
                 <outlet property="searchView" destination="a0a-sl-bPA" id="ZwG-50-IDo"/>
                 <outlet property="search_button" destination="Kuy-oy-vcr" id="NHZ-xx-f80"/>