소스 검색

1.修改SeekBar的使用方法

zhangmengjie 5 년 전
부모
커밋
6f40eeadb1
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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();