Android 如何减少“数字选择器”对话框的活动大小
如何减少数字选择器中的活动数字框边框大小Android 如何减少“数字选择器”对话框的活动大小,android,android-layout,android-widget,Android,Android Layout,Android Widget,如何减少数字选择器中的活动数字框边框大小 <NumberPicker android:id="@+id/number_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:lay
<NumberPicker
android:id="@+id/number_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:theme="@style/AppTheme.Picker"
android:descendantFocusability="blocksDescendants"
android:gravity="center" />
您可以尝试添加android:scaleY=“0.8”
它仍然会使用不必要的填充,但顶部填充保持如上图所示仅减少活动框大小a填充将在那里,您可以保留类似android:layou marginTop=“-20dp”
的hack来隐藏额外填充,而不是减少此填充,我使用了android:scaleY=“0.8”android:layout_marginTop=“-20dp”
不工作吗?