Browse Source

1,btn 都设置成按下触发点击事件,这里有手势冲突会延迟 导致卡顿现象。2, TTS显示错误提示里才出提示框

jsonwang 3 years ago
parent
commit
7b345ebe88

+ 9 - 3
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -442,8 +442,9 @@ public class BFRecordScreenController: BFBaseViewController {
         btn.setImage(imageInRecordScreenKit(by: "subtitleBtn_on"), for: .normal)
         btn.setTitle("function_subtitle".BFLocale, for: .normal)
         btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
-        btn.addTarget(self, action: #selector(subTitleClick), for: .touchUpInside)
+        btn.addTarget(self, action: #selector(subTitleClick), for: .touchDown)
         btn.imageEdgeInsets = UIEdgeInsets(top: -20, left: 4, bottom: 0, right: -4)
+        btn.adjustsImageWhenHighlighted = false
         btn.titleEdgeInsets = UIEdgeInsets(top: 20, left: -40, bottom: -20, right: 0)
         return btn
     }()
@@ -454,7 +455,8 @@ public class BFRecordScreenController: BFBaseViewController {
         btn.setImage(imageInRecordScreenKit(by: "soundBtn"), for: .normal)
         btn.setTitle("function_voice".BFLocale, for: .normal)
         btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
-        btn.addTarget(self, action: #selector(soundSetting), for: .touchUpInside)
+        btn.adjustsImageWhenHighlighted = false
+        btn.addTarget(self, action: #selector(soundSetting), for: .touchDown)
         btn.imageEdgeInsets = UIEdgeInsets(top: -20, left: 4, bottom: 0, right: -4)
         btn.titleEdgeInsets = UIEdgeInsets(top: 20, left: -40, bottom: -20, right: 0)
         return btn
@@ -466,8 +468,9 @@ public class BFRecordScreenController: BFBaseViewController {
         btn.setImage(imageInRecordScreenKit(by: "TTS"), for: .normal)
         btn.setTitle("变声", for: .normal)
         btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
-        btn.addTarget(self, action: #selector(voiceSetting), for: .touchUpInside)
+        btn.addTarget(self, action: #selector(voiceSetting), for: .touchDown)
         btn.imageEdgeInsets = UIEdgeInsets(top: -20, left: 4, bottom: 0, right: -4)
+        btn.adjustsImageWhenHighlighted = false
         btn.titleEdgeInsets = UIEdgeInsets(top: 20, left: -40, bottom: -20, right: 0)
         return btn
     }()
@@ -2892,6 +2895,9 @@ extension BFRecordScreenController: BFTTSManagerDelegte{
  
     public func ttsDebugHandle(_ msg:String, isShow: Bool){
         BFLog(message: "TTS 出现错误\(msg)")
+        if(!isShow){
+            return
+        }
         let alertController = UIAlertController(title: "哎呀,变声失败了",
                        message: "", preferredStyle: .alert)
         let cancelAction = UIAlertAction(title: "取消变音", style: .default, handler: {[weak self]