3

画面の下部に EditText と Button を含むレイアウトがあります。この上に ListView があります。キーボードがポップアップしたときに EditText とボタンが表示されるようにします。しかし、windowSoftInputMode="adjustResize" を指定しても、これは起こっていません。

以下は私のレイアウトです:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/recents_header_bg"
    android:padding="2dp" >

    <TextView
        android:id="@+id/tv_msg_header"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Name"
        android:textColor="@color/white1"
        android:textSize="15sp" />

    <Button
        android:id="@+id/bt_msg_cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:background="@drawable/bt_call_log"
        android:text="Cancel"
        android:textColor="@color/white1" />
</RelativeLayout>

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_gravity="center"
    android:layout_weight="1" >

    <ListView
        android:id="@+id/lv_msg_thread_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:cacheColorHint="#00000000"
        android:divider="@color/recents_list_seperator"
        android:dividerHeight="1dp"
        android:duplicateParentState="true"
        android:fadingEdge="none"
        android:fastScrollEnabled="true" >
    </ListView>

    <TextView
        android:id="@+id/tv_msg_error"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:visibility="gone" />
</FrameLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/grey05"
    android:orientation="vertical"
    android:padding="1dp" >

    <EditText
        android:id="@+id/et_msg_entry"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:gravity="top"
        android:hint="Type your message here" />

    <Button
        android:id="@+id/bt_msg_send"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:background="@drawable/bt_call_log"
        android:text="Send"
        android:textColor="@color/white1" />
</LinearLayout>

また、アクティビティに与えられた私のメインフェストのオプションは次のとおりです。

<activity
        android:name=".ui.MessageActivity"
        android:screenOrientation="portrait" 
        android:windowSoftInputMode="stateHidden|adjustResize"
        android:exported="false"/>

これを行う方法はありますか?デフォルトのメッセージ アプリのように

4

1 に答える 1