-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过点击的方式切换,没有滑动回调。 #84
Comments
实际问题,是滑动状态错误 |
不太理解你说的意思 |
场景是这样的: 方案1: 我设置了setOnScrollListener来监听控件的滑动状态,但是,当前我通过点击,控件会自动切换下一项,但是没有触发scrollListener回调 方案2: 通过设置setOnValueChangedListener,来监听最新值,但是这个回调太频繁,而且这里有问题,例如:原本是选项是2,通过点击切换,最新值会回调:3->2->3,回调三次 所以,有什么方案可以获取到,控件停止滑动时,当前的值吗 `
` |
这个目前没有很好的方法解决,如果你接受不了方案二频繁回调的话,我的建议是自己使用numberpicker类似的控件替换掉控制器内的numberpicker,因为仓库内的numberpicker是基于android number picker来修改的,这段时间比较忙,所以可能没有充足的时间来更新。 |
我是直接使用:
<com.loper7.date_time_picker.number_picker.NumberPicker android:id="@+id/dateTimePicker2" android:layout_width="match_parent" android:layout_height="@dimen/dp_50" android:layout_marginTop="@dimen/dp_12" app:layout_constraintTop_toBottomOf="@id/tv_tip_cl2" app:np_dividerColor="@android:color/transparent" app:np_max="40" app:np_min="1" app:np_orientation="horizontal" app:np_selectedTextColor="@color/vm_color_brand_hover" app:np_selectedTextSize="@dimen/sp_16" app:np_textColor="@color/vm_color_text_01" app:np_textSize="@dimen/sp_14" app:np_value="12" app:np_wheelItemCount="7" app:np_wrapSelectorWheel="false" />
建议公开:mScrollState属性,如果我通过setOnValueChangedListener的值来获取选中的选项,会回调太频繁
The text was updated successfully, but these errors were encountered: