Quellcode durchsuchen

1.修改SeekBar的使用方法

zhangmengjie vor 5 Jahren
Ursprung
Commit
6f40eeadb1
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      pages/components/SeekBar.js

+ 5 - 2
pages/components/SeekBar.js

@@ -205,7 +205,10 @@ const styles = StyleSheet.create({});
             progress={this.state.curprogress}
           />
 
-
+  state = {
+    curprogress: 0,
+    max: 100
+  };
  touch_up_callback(progress) {
     //抬起之后,获取算出来的progress
     this.setState({
@@ -222,7 +225,7 @@ const styles = StyleSheet.create({});
         });
       }
 
-      if (this.state.curprogress >= 100) {
+      if (this.state.curprogress >= this.state.max) {
         alert("100了");
       } else {
         this.setProgressIcon();