Browse Source

UI 调整

jsonwang 3 years ago
parent
commit
9ecce4190a

+ 20 - 4
BFRecordScreenKit/Classes/RecordScreen/View/BFVoiceSettingView.swift

@@ -49,13 +49,27 @@ class BFVoiceSettingView: UIView {
     var curretnCategory: BFVoiceCategoryModel?
     // 当前选择的发音人
     public var selectVoice: PQVoiceModel?
+    
+    
 
+    lazy var line1:UIView = {
+        let line1 = UIView.init(frame: CGRect(x: 0, y: catagaryCollectView.frame.minY - 1, width: cScreenWidth, height: 1))
+        line1.backgroundColor = UIColor.hexColor(hexadecimal: "#272727")
+        return line1
+        
+    }()
+    lazy var line2:UIView = {
+        let line2 = UIView.init(frame: CGRect(x: 0, y: catagaryCollectView.frame.maxY + 1, width: cScreenWidth, height: 1))
+        line2.backgroundColor = UIColor.hexColor(hexadecimal: "#272727")
+        return line2
+        
+    }()
     // 分类列表
     lazy var catagaryCollectView: UICollectionView = {
         let layout = UICollectionViewFlowLayout()
         layout.scrollDirection = .horizontal
         layout.itemSize = itemSize
-        layout.minimumLineSpacing = 10
+        layout.minimumLineSpacing = 30
         layout.sectionInset = UIEdgeInsets.zero
         layout.minimumInteritemSpacing = 0
         let collectView = UICollectionView(frame: CGRect(x: 60, y: 0, width: cScreenWidth, height: 40), collectionViewLayout: layout)
@@ -97,12 +111,12 @@ class BFVoiceSettingView: UIView {
         layout.scrollDirection = .vertical
         layout.itemSize = CGSize(width: adapterWidth(width: 60), height: 78)
         // 每行最小边距
-        layout.minimumLineSpacing = 10
+        layout.minimumLineSpacing = 34
         // 每列最小边距
-        layout.minimumInteritemSpacing = 0
+        layout.minimumInteritemSpacing = 20
         layout.sectionInset = UIEdgeInsets.zero
 
-        let collectView = UICollectionView(frame: CGRect(x: 0, y: 98, width: cScreenWidth, height: 242 - cSafeAreaHeight), collectionViewLayout: layout)
+        let collectView = UICollectionView(frame: CGRect(x: 32, y: 100, width: cScreenWidth - 32 * 2, height: 242 - cSafeAreaHeight), collectionViewLayout: layout)
         collectView.isPagingEnabled = false
         collectView.showsHorizontalScrollIndicator = false
         collectView.showsVerticalScrollIndicator = false
@@ -187,6 +201,8 @@ class BFVoiceSettingView: UIView {
         }
 
         catagaryBackView.addSubview(catagaryCollectView)
+        catagaryBackView.addSubview(line1)
+        catagaryBackView.addSubview(line2)
 
         catagaryBackView.addSubview(deleteBtn)
         deleteBtn.snp.makeConstraints { make in

+ 22 - 1
BFRecordScreenKit/Classes/RecordScreen/View/Cell/BFVoiceCategoryCell.swift

@@ -17,10 +17,17 @@ class BFVoiceCategoryCell: UICollectionViewCell {
     lazy var nameLab: UILabel = {
         let nameLab = UILabel()
         nameLab.textColor =  UIColor.hexColor(hexadecimal: "#616161")
-        nameLab.font = UIFont.boldSystemFont(ofSize: 15)
+        nameLab.font = UIFont.systemFont(ofSize: 15)
         nameLab.textAlignment = .center
         return nameLab
     }()
+    
+    lazy var line1:UIView = {
+        let line1 = UIView.init()
+        line1.backgroundColor = UIColor.white
+        return line1
+        
+    }()
  
 
     override init(frame: CGRect) {
@@ -28,6 +35,8 @@ class BFVoiceCategoryCell: UICollectionViewCell {
         backgroundColor = UIColor.clear
  
         contentView.addSubview(nameLab)
+        
+        contentView.addSubview(line1);
  
     }
 
@@ -50,6 +59,8 @@ class BFVoiceCategoryCell: UICollectionViewCell {
     func addData() {
         nameLab.text = category?.cateName
         nameLab.textColor = (category?.isSelected ?? false) ? UIColor.white :  UIColor.hexColor(hexadecimal: "#616161")
+        line1.isHidden = (category?.isSelected ?? false) ? false:  true
+     
     }
 
     func addLayout() {
@@ -60,6 +71,16 @@ class BFVoiceCategoryCell: UICollectionViewCell {
             make.top.equalToSuperview()
 
         }
+        
+        let itemWidth = sizeWithText(text: nameLab.text ?? "", font: UIFont.systemFont(ofSize: 15), size: CGSize(width: CGFloat.greatestFiniteMagnitude, height:15)).width
+        
+        line1.snp.remakeConstraints { make in
+            make.width.equalTo(itemWidth)
+            make.centerX.equalTo(nameLab.snp.centerX)
+            make.height.equalTo(2)
+            make.top.equalTo(nameLab.snp.bottom).offset(-2)
+
+        }
  
     }
 }