2013-03-01 55 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