我在ScrollView中有很少的editText。如果有很多editTexts,并且它们超出显示,一切正常,但如果它们没有,并且打开了软键盘,我就无法滚动它(键盘覆盖其中几个)。我的布局:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>
有什么建议吗?
答案 0 :(得分:1)
我在ScrollView标记中添加了这个字段:
android:isScrollContainer="false"
答案 1 :(得分:0)
您可以为活动使用windowSoftInputMode属性并将其设置为“adjustResize”。这将为您的软键盘腾出空间。
<activity android:windowSoftInputMode="adjustResize" />
答案 2 :(得分:0)
您可能需要更改清单文件中活动的“windowSoftInputMode”:
android:windowSoftInputMode="adjustResize"
我会尝试。