【发布时间】:2023-03-10 02:32:01
【问题描述】:
我有一个靠近 Activity 底部的 NumberPicker 元素。当用户向下滚动时,会单击“返回”按钮。我想禁用 NumberPicker 区域之外的滚动。
似乎没有明确的选择。
这是片段内的 xml:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/string1_id" />
<NumberPicker
android:id="@+id/number_picker_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@color/colorGray"></NumberPicker>
</LinearLayout>
我希望当手指滚动经过 NumberPicker 区域时,NumberPicker 会停止滚动。
【问题讨论】:
标签: java android numberpicker