[英]Android 4.0 softkeyboard overlaps EditText
找不到解決方案,如何避免位於主窗口底部ScrollView下的EditText彈出SoftKeyboard出現重疊。 我花了一天的時間在這里尋找解決方案,但所有建議如下:
我添加了android:descendantFocusability =“ beforeDescendants” android:focusableInTouchMode =“ true”和android:focusable =“ true” android:focusableInTouchMode =“ true”-並沒有幫助。
調整清單:
<activity
android:name=".mvc.views.SightingDetailsActivity"
android:theme="@android:style/Theme.Black"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustPan"
/>
已解決低於4.0(2.2、2.3和3.2)的Android的問題,但尚未解決Android 4.0及更高版本的問題。
use scroll View as a parent and put the other layout component as
a child inside this scroll View.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:layout_height="match_parent">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:focusableInTouchMode="true">
<TableRow
android:layout_width="match_parent"
android:padding="20dp"
android:layout_height="wrap_content">
<TextView
android:text="@string/introduction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="27dp"
android:textColor="@color/green"
android:layout_span="4"
android:gravity="center_horizontal"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/green">
<TextView android:layout_span="2"
android:layout_height="1dp"
android:layout_width="match_parent"
android:text="">
</TextView>
</TableRow>
</ScrollView>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.