3
我正在Android中執行消息傳遞屏幕。佈局是LinearLayout。adjustResize和軟鍵盤開啓時保留EditText比例
但當鍵盤可見。
佈局的在底部的比例就會混亂。我如何強制它保持其比例?這是我的佈局文件。我嘗試adjustPan,editText是可見的,但行動欄已經消失。我想使用adjustResize,因爲我也想操作欄,但editText不再可見。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:flatui="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/background_grey"
android:layout_weight="93" >
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textAppearance="@android:style/TextAppearance.Large"
android:text="No chat history." />
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="5dp"
android:layout_weight="7">
<com.cengalabs.flatui.views.FlatEditText
android:id="@+id/message"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:gravity="top"
android:hint="Message"
android:layout_marginRight="5dp"
flatui:theme="Deep"
flatui:fieldStyle="transparentBox"
flatui:cornerRadius="3dip"/>
<com.cengalabs.flatui.views.FlatButton
android:id="@+id/sign_in_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="Send"
android:layout_weight="1"
flatui:theme="Deep"
flatui:textAppearance="none"/>
</LinearLayout>
</LinearLayout>
你可以在你的清單文件寫???? –
@BornToWin我添加到activity標籤的唯一的東西是'android:windowSoftInputMode =「stateHidden | adjustResize」' – Boy