Parcourir la source

1.修改SeekBar的使用方法

zhangmengjie il y a 5 ans
Parent
commit
6f40eeadb1
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  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();