2017-04-25 3 views
0

스크롤 도구 모음이 내 프로그램에서 작동하는 데 약간의 문제가 있습니다. 지금 당장 툴바는 마치 스크롤하는 것을 전혀 구현하지 않은 것처럼 행동합니다.프레임 레이아웃을 사용하여 안드로이드에서 스크롤 도구 모음이 작동하지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 

<android.support.v7.widget.RecyclerView 
    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:id="@+id/matchRV" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 
    </android.support.v7.widget.RecyclerView> 

나는 아마 뭔가 바보 될 것 알고 있지만 난 그냥 수 없습니다 : 나는 다음과 레이아웃이 조각으로 FrameLayout이를 작성하고

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/activity_summoner_search" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.kevin.leagueoflegendshelper.SummonerSearchActivity"> 


    <android.support.v4.widget.DrawerLayout 
     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/drawer_Layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true"> 

     <android.support.design.widget.CoordinatorLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

      <android.support.design.widget.AppBarLayout 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       android:id="@+id/appBarLayout"> 

       <android.support.design.widget.CollapsingToolbarLayout 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        app:layout_scrollFlags="scroll|exitUntilCollapsed"> 

        <android.support.v7.widget.Toolbar 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:id="@+id/toolBar" 
         android:background="@color/colorPrimary" 
         android:elevation="4dp" 
         android:theme="@style/ThemeOverlay.AppCompat.ActionBar" 
         app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
         app:layout_collapseMode="parallax"> 

         <TextView 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:text="placeholder" 
          android:id="@+id/toolBar_Title" 
          style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" 
          android:layout_gravity="start" 
          app:layout_collapseMode="parallax" 
          android:fitsSystemWindows="true"/> 
        </android.support.v7.widget.Toolbar> 

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

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



      <FrameLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:id="@+id/frameLayout" 
       app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Search for a summoner to begin" 
        android:textSize="36dp" 
        android:paddingTop="10dp" 
        android:id="@+id/searchLabel"/> 
      </FrameLayout> 

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

     <android.support.design.widget.NavigationView 
      android:id="@+id/nav_View" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="start" 
      android:fitsSystemWindows="true" 
      android:paddingTop="20dp" 
      app:menu="@menu/main_drawer_layout"> 

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


    </android.support.v4.widget.DrawerLayout> 



</RelativeLayout> 

: 같은 내 활동 XML이다 나를 위해 일할 수있는 것 같습니다. 어떤 도움을 주시면 감사하겠습니다.

+0

아래 내 대답을 확인 ... – FAT

+0

영업 이익은 자동으로 알림을받을 것입니다 ... 답변이 올 때 ... 호들갑을 떨고 할 필요가 @FerdousAhamed하지 – rafsanahmad007

답변

0

속성을 추가 app:layout_scrollFlags="scroll|enterAlways"에서 Toolbar으로 변경하십시오.

이 시도 :

<android.support.v7.widget.Toolbar 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/toolBar" 
    android:background="@color/colorPrimary" 
    android:elevation="4dp" 
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar" 
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
    app:layout_scrollFlags="scroll|enterAlways" 
    app:layout_collapseMode="parallax"> 
+0

, 감사합니다 이게 내가 놓친 것입니다! – KevinCamacho

관련 문제