7

을 열 때 실행 바 숨 깁니다 I SendMessageLayout이 글고 치기와 버튼과 단지 배치하는 동안 다음과 같은 레이아웃을RecyclerView는 SoftKeyboard가

<?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:id="@+id/container"> 

    <com.example.SendMessageLayout 
     android:id="@+id/chatMessageLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     /> 

    <View 
     android:id="@+id/separator" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_above="@id/chatMessageLayout" 
     android:background="@color/seperator_line_inpost" 
     /> 

    <android.support.v4.widget.SwipeRefreshLayout 
     android:id="@+id/swipe_container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentTop="true" 
     android:layout_above="@id/separator" 
     > 

     <android.support.v7.widget.RecyclerView 
      android:id="@+id/recycleView" 
      style="@style/BeepMeListView" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@+id/chatMessageLayout" 
      android:layout_alignParentTop="true" 
      android:transcriptMode="alwaysScroll" 
      /> 
    </android.support.v4.widget.SwipeRefreshLayout> 

</RelativeLayout> 

있습니다. 이전 구현에서는 일반 ListView를 사용 했으므로 편집 텍스트의 포커스를 요청하면 키보드가 나타나고 목록보기가 이동하지 않고 첫 번째 항목이 표시되었습니다. 그러나 RecyclerView를 사용하면 모든 항목이 위로 올려집니다. 맨 위 항목 만 화면에서 벗어나지 않고 전체 레이아웃이 ActionBar 위에 있습니다.

다음

보이는 방법 ... RecycleView Screenshot

+0

나는 같은 문제가 있습니다. 누군가 도와 줄 수 있습니까? – Sandra

+0

안녕, 이걸 알아내는 행운? – alexk

+0

XML로 작업 표시 줄을 배치하는 방법을 게시 할 수 있습니까? – dumbfingers

답변

5

그냥 해결 빈있는 ScrollView 추가 : 이것처럼 RecyclerView hides Actionbar when SoftKeyboard is opened 解决办法

:

<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="vertical" 
    android:layout_height="match_parent" 
    android:layout_width="match_parent" 
    tools:context="me.drakeet.seashell.ui.social.PostActivity"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
    </ScrollView> 

    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <me.drakeet.seashell.widget.MultiSwipeRefreshLayout 
      android:layout_weight="1" 
      android:layout_marginBottom="4dp" 
      android:id="@+id/swipe_refresh_layout" 
      style="@style/BbsBackground" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

      <android.support.v7.widget.RecyclerView 
       android:id="@+id/rv_reply_list" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:minHeight="48dp"/> 

     </me.drakeet.seashell.widget.MultiSwipeRefreshLayout> 

     <include 
      android:layout_gravity="bottom" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      layout="@layout/view_reply"/> 
    </LinearLayout> 

</FrameLayout> 
0

내가 같은 문제를 가지고와 내가 그것을 추가 해결

android:windowSoftInputMode="adjustResize"

매니 페스트의 활동 태그에

관련 문제