2013-03-01 56 views
3

這是我的Fragment的佈局文件。爲什麼Android Softkeyboard隱藏最底層的TextView?

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <!-- android:fillViewport="true" --> 

    <EditText 
     android:id="@+id/chatDispWindow" 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     android:layout_above="@+id/chatTypeWindow" 
     android:layout_alignParentTop="true" 
     android:layout_marginLeft="9dp" 
     android:layout_marginRight="6dp" 
     android:background="@color/background_color" 
     android:clickable="false" 
     android:cursorVisible="false" 
     android:focusable="false" 
     android:focusableInTouchMode="false" 
     android:gravity="bottom" 
     android:inputType="textMultiLine|textLongMessage|textNoSuggestions" 
     android:scrollHorizontally="true" /> 
    <!-- android:hint="@string/groupChatDispMsg" --> 

    <ImageButton 
     android:id="@+id/sendBtn" 
     android:layout_width="52dp" 
     android:layout_height="46dp" 
     android:layout_above="@+id/chatStatusWindow" 
     android:layout_alignBottom="@+id/chatTypeWindow" 
     android:layout_alignParentRight="true" 
     android:layout_marginBottom="-3dp" 
     android:layout_marginLeft="4dp" 
     android:background="@drawable/send_chatbtn_selector" 
     android:contentDescription="@string/sendLbl" /> 

    <EditText 
     android:id="@+id/chatTypeWindow" 
     android:layout_width="match_parent" 
     android:layout_height="45dp" 
     android:layout_above="@+id/chatStatusWindow" 
     android:layout_alignParentLeft="true" 
     android:layout_marginLeft="6dp" 
     android:layout_toLeftOf="@+id/sendBtn" 
     android:background="@drawable/editbox_selector" 
     android:imeActionId="@+id/sendChatImeBtn" 
     android:imeActionLabel="@string/sendLbl" 
     android:imeOptions="actionSend" 
     android:inputType="textMultiLine" 
     android:minHeight="45dp" /> 
    <!-- android:hint="@string/chatWindowMsg" --> 

    <TextView 
     android:id="@+id/chatStatusWindow" 
     android:layout_width="match_parent" 
     android:layout_height="15dp" 
     android:layout_alignParentBottom="true" 
     android:layout_marginBottom="3dp" 
     android:layout_marginLeft="9dp" /> 
    <!-- android:text="@string/chatStatusMsg" --> 

</RelativeLayout> 

這是現在應用的行爲......

Default View Ui When User clicks on the EditText

問題是鍵盤隱藏屏幕下方最TextView的,我怎樣才能讓可見光連如果鍵盤顯示?

我試過使用android:windowSoftInputMode="adjustResize"但它不工作。請大家幫忙,

編輯 進一步深挖中後我才知道,如果我刪除全屏主題然後android:windowSoftInputMode="adjustResize完美。如何使用FullScreen主題獲得此功能?

+0

我得到了完全相同的問題,有沒有人知道解決方案? – Vigor 2015-08-08 16:03:23

回答

1

我用android:windowSoftInputMode="adjustResize"從這個活動取出full screen theme下,我發現其Android的known issue。他們聲稱它已經解決了,但它至少不在我測試我的代碼的設備上。

我希望這個答案對將來訪問此主題的人有用,並且可以節省他們的時間和精力。謝謝大家,

+0

謝謝,它工作得很好,只是節省了我很多時間! :) – PAD 2015-06-14 14:48:04

1

嘗試這個清單文件,您的活動

android:windowSoftInputMode="adjustPan" 
+0

它不工作... – aProgrammer 2013-03-01 12:12:15