0

안녕하세요 저는 리사이클 뷰를 스크롤 할 때 상태 표시 줄이 위로 스크롤되어 이상한 문제가 발생했습니다. 다른 모든 것은 그것이되어야하는 것처럼 작동합니다. 나는 나의 레이아웃이 추가되는 방법이라고 생각하지만 문제가 어디에 있을지 확신하지 못한다. 아이디어가 있으면 알려주세요. 고맙습니다!상태 표시 줄이 리사이클보기로 표시됩니다.

CODE :

app_bar_main

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context="com.application.app.Activity.MainActivity"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/AppTheme.AppBarOverlay"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app:popupTheme="@style/AppTheme.PopupOverlay" 
      app:layout_scrollFlags="scroll|enterAlways" /> 

    </android.support.design.widget.AppBarLayout> 

    <include layout="@layout/content_main" /> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom|end" 
     android:layout_margin="@dimen/fab_margin" 
     app:srcCompat="@android:drawable/ic_dialog_email" /> 

</android.support.design.widget.CoordinatorLayout> 

content_main

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/content_main" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context="com.application.app.Activity.MainActivity" 
    tools:showIn="@layout/app_bar_main"> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/frame"> 

    </FrameLayout> 
</RelativeLayout> 

단편

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 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="match_parent"> 

    <android.support.v7.widget.RecyclerView 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/recyclerView" 
     android:layout_height="match_parent" 
     android:layout_width="match_parent" 
     /> 

</RelativeLayout> 
+1

'RelativeLayout'에서'app : layout_behavior = "@ string/appbar_scrolling_view_behavior'을 제거하려고 시도하십시오. – nullbyte

+0

@vpaliyX 예. 고맙습니다.하지만이 작업을 시도해 보았습니다. 실제 활동? – paul590

답변

1
<android.support.v7.widget.Toolbar  
    android:id="@+id/toolbar" 
    android:layout_width="match_parent"   
    android:layout_height="?attr/actionBarSize"    
    android:background="?attr/colorPrimary"    
    app:popupTheme="@style/AppTheme.PopupOverlay"   
    app:layout_scrollFlags="scroll|enterAlways" /> 

마지막 줄의 코드는 도구 모음을 위로 스크롤 할 수있게합니다. 하지만 당신이 '상태 표시 줄'이라고 말했을 때, 이것이 도움이 될지 모르겠습니다. '상태 표시 줄'을 위로 스크롤해야 할 때 활동 코드에서 수행합니다. 레이아웃에서 작동하지 않을 수 있습니다.

+0

네, 툴바를 스크롤 할뿐 아니라 상태 표시 줄을 스크롤하고 도구 모음 내용을 숨기지 않고 스크롤하여 이상하게 만듭니다. – paul590