瀏覽代碼

设置字号 UI 调整

jsonwang 3 年之前
父節點
當前提交
d121d23f11
共有 17 個文件被更改,包括 122 次插入28 次删除
  1. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/Contents.json
  2. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/wordSizeSetting+_h.png
  3. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/wordSizeSetting+_h@2x.png
  4. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/wordSizeSetting+_h@3x.png
  5. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/Contents.json
  6. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/wordSizeSetting+_n.png
  7. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/wordSizeSetting+_n@2x.png
  8. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/wordSizeSetting+_n@3x.png
  9. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/Contents.json
  10. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/wordSizeSetting-_h.png
  11. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/wordSizeSetting-_h@2x.png
  12. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/wordSizeSetting-_h@3x.png
  13. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/Contents.json
  14. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/wordSizeSetting-_n.png
  15. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/wordSizeSetting-_n@2x.png
  16. 二進制
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/wordSizeSetting-_n@3x.png
  17. 30 28
      BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "wordSizeSetting+_h.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "wordSizeSetting+_h@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "wordSizeSetting+_h@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/wordSizeSetting+_h.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/wordSizeSetting+_h@2x.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_h.imageset/wordSizeSetting+_h@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "wordSizeSetting+_n.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "wordSizeSetting+_n@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "wordSizeSetting+_n@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/wordSizeSetting+_n.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/wordSizeSetting+_n@2x.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting+_n.imageset/wordSizeSetting+_n@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "wordSizeSetting-_h.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "wordSizeSetting-_h@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "wordSizeSetting-_h@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/wordSizeSetting-_h.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/wordSizeSetting-_h@2x.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_h.imageset/wordSizeSetting-_h@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "wordSizeSetting-_n.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "wordSizeSetting-_n@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "wordSizeSetting-_n@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/wordSizeSetting-_n.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/wordSizeSetting-_n@2x.png


二進制
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/wordSizeSetting-_n.imageset/wordSizeSetting-_n@3x.png


+ 30 - 28
BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

@@ -37,8 +37,9 @@ class BFSubtitleSettingView: UIView {
         backgroundColor = UIColor.clear
         addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hidden)))
 
-        let backView = UIView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
+        let backView = UIButton()
         backView.backgroundColor = .black
+
         addSubview(backView)
         backView.snp.makeConstraints { make in
             make.right.equalTo(self.snp.right)
@@ -136,22 +137,14 @@ class BFSubtitleSettingView: UIView {
         for i in 0...1 {
             let wordSizeBtn = UIButton(type: .custom)
             wordSizeBtn.addTarget(self, action: #selector(wordSizeSetting(sender:)), for: .touchUpInside)
-            wordSizeBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#1A1A1A")
-            wordSizeBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#28BE67"), for: .selected)
-            wordSizeBtn.setTitleColor(.white, for: .normal)
-            wordSizeBtn.setTitle(i == 0 ? "-" : "+", for: .normal)
             backView.addSubview(wordSizeBtn)
             wordSizeBtn.tag = i
-            if i == 0 {
-                wordSizeBtn.isSelected = true
-                wordSizeBtn.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
-                wordSizeBtn.layer.borderWidth = 1.5
-                lastSelectwordSizeBtn = wordSizeBtn
-            }
-            wordSizeBtn.addCorner(corner: 10)
+            
+            wordSizeBtn.setBackgroundImage(imageInRecordScreenKit(by: i == 0 ? "wordSizeSetting-_h" : "wordSizeSetting+_h"), for: .normal)
+ 
             wordSizeBtn.snp.makeConstraints { make in
-                make.width.equalTo(30)
-                make.height.equalTo(30)
+                make.width.equalTo(24)
+                make.height.equalTo(24)
                 make.left.equalTo(wordSizeTitle.snp.right).offset(10 + i * Int(30 + 10))
 
                 make.centerY.equalTo(pointTitle.snp.centerY)
@@ -245,22 +238,31 @@ class BFSubtitleSettingView: UIView {
     }
 
     @objc func wordSizeSetting(sender: UIButton) {
-        lastSelectwordSizeBtn.isSelected = false
-        lastSelectwordSizeBtn.layer.borderColor = UIColor.clear.cgColor
-
-        sender.isSelected = true
+        
+        if(sender.tag == 0){
+            if(subtitle.setting.subtitleSize > 20){
+                subtitle.setting.subtitleSize -= 10
+                
+                lastSelectwordSizeBtn.setImage(imageInRecordScreenKit(by:  "wordSizeSetting+_h"), for: .normal)
+                
+                sender.setImage(imageInRecordScreenKit(by:  "wordSizeSetting-_h"), for: .normal)
+            }else{
+                sender.setImage(imageInRecordScreenKit(by:  "wordSizeSetting-_n"), for: .normal)
+            }
+            
+        }else  if(sender.tag == 1){
+            if(subtitle.setting.subtitleSize < 120){
+                subtitle.setting.subtitleSize += 10
+                sender.setImage(imageInRecordScreenKit(by:  "wordSizeSetting+_h"), for: .normal)
+                lastSelectwordSizeBtn.setImage(imageInRecordScreenKit(by:  "wordSizeSetting-_h"), for: .normal)
+            }else{
+                sender.setImage(imageInRecordScreenKit(by:  "wordSizeSetting+_n"), for: .normal)
+            }
+            
+        }
+ 
         lastSelectwordSizeBtn = sender
 
-        sender.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
-        sender.layer.borderWidth = 1.5
-
-        if sender.tag == 0, subtitle.setting.subtitleSize > 20 {
-            subtitle.setting.subtitleSize -= 10
-        } else if sender.tag == 1, subtitle.setting.subtitleSize < 120 {
-            subtitle.setting.subtitleSize += 10
-        } else {
-            BFLog(message: "设置字号超出范围!")
-        }
         if subtitleSettingCallBack != nil {
             subtitleSettingCallBack!(subtitle)
         }