RulerView icon indicating copy to clipboard operation
RulerView copied to clipboard

setFirstScale实际效果差了数据10倍

Open ViolentBanana opened this issue 6 years ago • 1 comments

代码如下: rulerView.setFirstScale(58f) 实际定位到了 580.0 <com.lsp.RulerView android:id="@+id/rulerView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" lsp:bgColor="@color/white" lsp:firstScale="50" lsp:isBgRoundRect="false" lsp:largeScaleColor="#ff87868f" lsp:largeScaleStroke="2dp" lsp:maxScale="150" lsp:midScaleColor="#ffdddee0" lsp:midScaleStroke="2dp" lsp:minScale="35" lsp:resultNumColor="#0B0B0B" lsp:resultNumTextSize="20sp" lsp:rulerHeight="73.5dp" lsp:rulerToResultgap="32dp" lsp:scaleCount="10" lsp:scaleGap="5dp" lsp:scaleLimit="10" lsp:scaleNumColor="#575252" lsp:scaleNumTextSize="14sp" lsp:showScaleResult="true" lsp:smallScaleColor="#ffeaeaea" lsp:smallScaleStroke="1dp" lsp:unit="kg" lsp:unitColor="#87868F" lsp:unitTextSize="16sp" />

ViolentBanana avatar Jun 10 '20 10:06 ViolentBanana

使用rulerView.computeScrollTo(58f) 即可

ViolentBanana avatar Jun 10 '20 10:06 ViolentBanana