瀏覽代碼

自定义倍速自动插入UI 数据问题

jsonwang 3 年之前
父節點
當前提交
346eb59311

+ 1 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -1545,7 +1545,7 @@ extension PQStuckPointEditerController {
 
                     lastCyclesSelectIndex = lastCyclesSelectIndex + 1
                 }
-                speedSettingView.setSelectItem(index: lastCyclesSelectIndex, isSettingPlayer: false)
+                speedSettingView.setSelectItem(index: lastCyclesSelectIndex, isSettingPlayer: false,enableInsert: true)
             }
         } else {
             // 设置速度选择的位置

+ 4 - 2
BFFramework/Classes/Stuckpoint/View/PQSpeedSettingView.swift

@@ -114,7 +114,9 @@ class PQSpeedSettingView: UIView {
     ///   - index: index: 第几位 从0 开始
     ///   - isSettingPlayer: 是否重启播放器
     ///   - setEnable: 设置不可用状态
-    func setSelectItem(index:Int,isSettingPlayer:Bool = true,setDisable:Bool = false,isCancle:Bool = false) {
+    ///   - enableInsert: 是否插入一组新数据,只有第一次< 10s 设置为 true ,自定义及其它情况都不设置 true
+
+    func setSelectItem(index:Int,isSettingPlayer:Bool = true,setDisable:Bool = false,isCancle:Bool = false,enableInsert:Bool = false) {
        BFLog(message: "setSelectItem is \(index)")
         if(index < 0 ){
             BFLog(message: "选择位置数据出错\(index)")
@@ -129,7 +131,7 @@ class PQSpeedSettingView: UIView {
         lastSelectModel?.isSelected = false
        
         if viewType == 3{
-            if(index > 4 && datas.count < 7){
+            if(index > 4 && datas.count < 7 && enableInsert){
                 if(index >= datas.count){
                     let model = PQSpeedTitleModel()
                     model.title = "\(index + 1)x"