2012-09-06 80 views
1

無法找到解決方案如何避免我的EditText位於主窗口底部的彈出式SoftKeyboard重疊,就在ScrollView下。 我做了這裏尋找解決方案了一天,但所有的建議: Android 4.0軟鍵盤重疊EditText

我加 機器人:descendantFocusability =「beforeDescendants」 機器人:focusableInTouchMode =「真」 和 機器人:可調焦=「真正的」機器人:focusableInTouchMode =「true」 - 這沒有幫助。

院校佈局結構調整的清單:

<activity 
    android:name=".mvc.views.SightingDetailsActivity" 
    android:theme="@android:style/Theme.Black" 
    android:screenOrientation="portrait" 
    android:windowSoftInputMode="stateHidden|adjustPan" 
    /> 

已經解決了這個問題,爲Android低於4.0(2.2,2.3和3.2),但一直沒有解決的問題爲Android 4.0和更高版本。

回答

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> 
+0

根據活動頁面的設計,EditText必須位於佈局的底部,始終可見,與滾動ScrollView無關。 –