react-native-gizwits-scroll-ruler 1.0.7 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,7 +57,7 @@ public class RNScrollRulerManager extends SimpleViewManager {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
@ReactProp(name = "defaultValue")
|
|
60
|
-
public void setDefaultValue(RNScrollRuler ruler, @Nullable
|
|
60
|
+
public void setDefaultValue(RNScrollRuler ruler, @Nullable float defaultValue) {
|
|
61
61
|
ruler.setFirstScale(defaultValue);
|
|
62
62
|
}
|
|
63
63
|
@ReactProp(name = "unit")
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
<attr name="showScaleResult" format="boolean" /> <!--是否显示结果值-->
|
|
23
23
|
<attr name="isBgRoundRect" format="boolean" /> <!--背景是否圆角-->
|
|
24
24
|
<attr name="scaleLimit" format="integer" /> <!--相邻2个刻度之间的数量-->
|
|
25
|
+
<attr name="step" format="float" /> <!--step-->
|
|
25
26
|
<attr name="unit" format="string" /> <!--单位-->
|
|
26
27
|
<attr name="unitColor" format="color" /> <!--单位颜色-->
|
|
27
28
|
<attr name="unitTextSize" format="dimension" /> <!--单位字体大小-->
|
|
@@ -265,7 +265,8 @@
|
|
|
265
265
|
NSLog(@"设置默认值");
|
|
266
266
|
_defaultValue = defaultValue;
|
|
267
267
|
if (_maxValue != 0) {
|
|
268
|
-
|
|
268
|
+
double dv = ((defaultValue - _minValue)*10)/round(_step*10);
|
|
269
|
+
int v = (int)dv;
|
|
269
270
|
[self setRealValue:v animated:YES];
|
|
270
271
|
// [_collectionView setContentOffset:CGPointMake(((defaultValue-_minValue)/(float)_step)*RulerGap, 0) animated:YES];
|
|
271
272
|
}
|