Android中滑动数值选择器NumberPicker的用法分析
发布时间:2020-08-10 09:50:42
来源:亿速云
阅读:114
作者:小新
这篇文章将为大家详细讲解有关Android中滑动数值选择器NumberPicker的用法分析,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
简介:
NumberPicker: 用户既可以从键盘输值,也可以拖动来选择值
实际效果:
常用方法:
1. setMinValue() 设置组件支持的最小值
2. setMaxValue() 设置组建支持的最大值
3. setValue() 设置该组件的当前值
在布局文件中调用:
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="0dp&#