2013-06-24 44 views
0

我知道有關於這個問題的幾個職位,但我經歷了幾頁的谷歌結果,並沒有找到一個適用於我的情況的答案令人驚訝的足夠)。軟鍵盤覆蓋文本編輯框...通常的修補程序不工作

之前你給我的答案,共同...我試着改變清單到

android:windowSoftInputMode="adjustResize" 
android:windowSoftInputMode="adjustPan" 

和幾乎所有的可用選項的組合...沒有一個足夠我想要的東西。 「adjustResize」將我活動底部的所有內容都移動到......這不是有效的,因爲我在編輯文本下面有更多東西,「adjustPan」什麼都不做。

我也嘗試添加滾動視圖,但是這也沒有解決問題。是的,我可以滾動查看鍵盤打開的edittext,但這不是用戶友好的。

我將很高興與這兩種解決方案之一:

  1. 有softkeyboard對齊完全低於我目前使用的EditText框(理想的解決方案)或
  2. 有softkeyboard行爲,因爲它在橫向模式下進行並填充整個屏幕,同時允許我看到正在輸入的文本。

這裏是我的xml:

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="fill_parent" 
    android:layout_height="75dp" 
    android:layout_marginTop="20dp" 
    android:layout_alignParentTop="true" 
    android:contentDescription="@string/desc_logo" 
    android:src="@drawable/ccap_logo" /> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    android:layout_below="@+id/imageView1" 
    android:background="@drawable/home_background" > 

    <TextView 
     android:id="@+id/txtLastName" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" 
     android:layout_marginLeft="24dp" 
     android:layout_marginRight="24dp" 
     android:layout_marginTop="24dp" 
     android:text="@string/login_lastname" 
     android:textAppearance="?android:attr/textAppearanceLarge" /> 

    <EditText 
     android:id="@+id/etxtLastName" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_marginLeft="24dp" 
     android:layout_marginRight="24dp" 
     android:layout_below="@+id/txtLastName" 
     android:inputType="text" /> 

    <TextView 
     android:id="@+id/txtEmail" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/etxtLastName" 
     android:layout_marginLeft="24dp" 
     android:layout_marginRight="24dp" 
     android:text="@string/login_email" 
     android:textAppearance="?android:attr/textAppearanceLarge" /> 

    <EditText 
     android:id="@+id/etxtEmail" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="24dp" 
     android:layout_marginRight="24dp" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/txtEmail" 
     android:inputType="textEmailAddress" /> 

    <Button 
     android:id="@+id/btnSubmit" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_below="@+id/etxtEmail" 
     android:layout_marginTop="24dp" 
     android:text="@string/login_submit" 
     android:onClick="submitOnClick" /> 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentBottom="true" 
     android:text="@string/login_trouble" 
     android:textColor="#FFFFFF" 
     android:clickable="true" 
     android:onClick="emailCCAP" 
     android:textAppearance="?android:attr/textAppearanceSmall" /> 

</RelativeLayout> 

回答

0

你可能在你的活動設置在全屏模式下啓動。 adjustPan | adjustResize在全屏模式下不起作用。

相關問題