2013-04-28 2 views
3

У меня есть макет, который содержит EditText и Button в нижней части экрана. Выше это ListView. Я хочу, чтобы EditText и кнопка были видны при появлении keyBoard. Но это не hapening Inspite давать windowSoftInputMode = "adjustResize"Сделайте макет, содержащий editText, и кнопки сидят над клавиатурой

Ниже мой макет:

<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> 

Также в мои варианты MainFest данных для деятельности:

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

Есть ли способ сделать это ?. Как и в приложении по умолчанию для обмена сообщениями

ответ

1

Ваша ориентация LinearLayout должна быть horizontal, а не vertical.

Смежные вопросы