2016-02-04 5 views
0

Я добавляю настраиваемую панель действий в моей макете деятельности, когда клавиатура получает полноэкранный экран и скрывает панель действия, я использую android: softWindowInput = "adjustPan" свойство в Android Manifest, и попробовал android: softWindowInput = "adjustResize", но панель действий не спряталась, а скрывала клавиатуру EditText. Ниже приведен формат XML.Пользовательская панель действий скрывается при открытии клавиатуры

<?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:background="@drawable/tile_bg"> 

<!-- Top bar--> 
<include 
    android:id="@+id/app_bar" 
    layout="@layout/app_bar_chat" /> 
<!-- Chat Messages--> 
<ListView 
    android:id="@+id/lvChats" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/app_bar" 
    android:divider="@null" 
    android:scrollingCache="true" 
    android:smoothScrollbar="true" 
    android:layout_above="@+id/llMsgCompose" /> 

<!-- bottom layout for chat msg compose--> 
<RelativeLayout 
    android:id="@+id/llMsgCompose" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:background="@color/translucent_black" 
    android:padding="2dp" 
    android:visibility="visible"> 
    <!-- Mic button--> 
    <RelativeLayout 
     android:id="@+id/rl_Mic" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:background="@drawable/circle_red" 
     android:gravity="center" 
     android:padding="@dimen/pad_5dp"> 

     <ImageView 
      android:id="@+id/iv_Mic" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:background="@drawable/ic_mic" 
      android:textColor="@color/white" /> 

    </RelativeLayout> 
    <!-- Play button - It will get visible once the user press stop button--> 
    <RelativeLayout 
     android:id="@+id/rl_Play" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:layout_marginLeft="@dimen/pad_5dp" 
     android:background="@drawable/circle_red" 
     android:gravity="center" 
     android:padding="@dimen/pad_5dp" 
     android:visibility="gone"> 

     <ImageView 
      android:id="@+id/iv_play" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:background="@drawable/ic_play_recording" 
      android:textColor="@color/white" /> 

    </RelativeLayout> 
    <!-- Show recording time --> 
    <Chronometer 
     android:id="@+id/chronometer" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:textColor="@color/red" 
     android:textSize="@dimen/txt_20sp" 
     android:textStyle="bold" 
     android:visibility="gone" /> 

    <EditText 
     android:id="@+id/et_ChatMsg" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:layout_marginLeft="@dimen/pad_5dp" 
     android:layout_marginRight="@dimen/pad_5dp" 
     android:layout_toLeftOf="@+id/rl_Send" 
     android:layout_toRightOf="@+id/rl_Mic" 
     android:background="@color/white" 
     android:ellipsize="end" 
     android:gravity="center_vertical" 
     android:hint="@string/et_chat_msg" 
     android:padding="@dimen/pad_10dp" 
     android:singleLine="true" 
     android:textStyle="normal" 
     android:imeOptions="flagNoExtractUi" 
     /> 
    <!-- Send button--> 
    <RelativeLayout 
     android:id="@+id/rl_Send" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_centerVertical="true" 
     android:background="@drawable/circle_red" 
     android:gravity="center" 
     android:padding="@dimen/pad_5dp"> 

     <ImageView 
      android:id="@+id/iv_Send" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:background="@drawable/ic_send" 
      android:textColor="@color/white" /> 

    </RelativeLayout> 
</RelativeLayout> 

<ScrollView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/scrollView" 
    android:layout_alignTop="@+id/lvChats" 
    android:layout_alignParentEnd="true" /> 
</RelativeLayout>  

И мой заказ Бар Действие следующее:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar  xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="80dp" 
android:background="@color/red" 
android:fitsSystemWindows="true" 
app:popupTheme="@style/Theme.AppCompat"> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <ImageView 
     android:id="@+id/ivHeaderLogo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:layout_marginRight="@dimen/pad_5dp" 
     android:background="@drawable/ic_dialog_logo" 
     android:visibility="gone" /> 

    <TextView 
     android:id="@+id/tvScreenHeading" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:layout_toRightOf="@+id/ivHeaderLogo" 
     android:text="@string/chat_header_bar" 
     android:textColor="@android:color/white" 
     android:textSize="20sp" 
     android:visibility="visible" /> 


</RelativeLayout> 

</android.support.v7.widget.Toolbar>  

Любая помощь может быть оценены заранее спасибо.

+0

положить EditText внутри ScrollView – Durgesh

+0

сделал это не ответ –

+0

проверить этот ответ http://stackoverflow.com/ a/35168357/2826147 –

ответ

0

Проверьте, используете ли вы android:windowTranslucentStatus=true в стилях для своих app или activity theme.

+0

да я использую этот, что он делает разницу @Ragesh Ramesh –

0

пытаются использовать android:windowSoftInputMode="adjustResize" в манифесте для «деятельности» элемента & добавить android:layout_alignParentBottom="true" в вашей собственности EditText

+0

Пробовал без ответа @Azfaar –

+0

попытаться добавить android: layout_alignParentTop = "true"; в вашем теге include. –

+0

Нет ответа еще в той же ситуации :( –

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