0

this을 달성하기 위해이 가이드 CodePath을 수행하고 있습니다. 나는 확장 가능하고 접을 수있는 툴바를 원하지 않습니다. 난 그냥 레이아웃과 최대 스크롤 올라가서 (위로 가기 모든 방법을 도달 할 때) 위로 올라 오자마자 나타나는 위로 간단한 Toolbar 싶습니다.
나는 Codepath 가이드를 따라이 Layout을 만들었습니다. 그러나 NestedScrollView의 스크롤은 여기서 작동하지 않습니다.
그래서 StackOverflow에서 CoordinatorLayout의 내용을 LinearLayout에 넣고 스크롤하는 것이 좋습니다 (NewLayout)라는 대답을 발견했습니다. 그러나 Toolbar은 레이아웃의 나머지 부분과 함께 스크롤하지 않고 상단에 고정되어 있으며과 같이 Codepath 가이드에서 언급 한 것과 같은 것을 기대하고있었습니다.Android - enter always는 작동하지 않습니다. 툴바는 나머지 레이아웃과 함께 스크롤하지 않습니다.

내가 뭘 잘못하고 있니? 감사합니다

답변

1

NestedScrollView는 외부 appbarlayout 수 아래의 예제 코드를 참조해야합니다

<android.support.design.widget.CoordinatorLayout 
    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.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

    <!-- Your scrolling content --> 

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

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

    <android.support.v7.widget.Toolbar 
      ... 
      app:layout_scrollFlags="scroll|enterAlways"/> 

    <android.support.design.widget.TabLayout 
      ... 
      app:layout_scrollFlags="scroll|enterAlways"/> 

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

참조 : https://developer.android.com/reference/android/support/design/widget/AppBarLayout.html

가 작동 희망!

+0

답변 주셔서 감사합니다 Abhinav,하지만 그것은 내가 생각했던대로 작동하지 않습니다. 이제 내가 얻은 것은 도구 모음이 맨 위에 있고 빈 영역이 뒤 따르지 만 스크롤 할 때 도구 모음 크기로 스크롤 할 수있는 기본 레이아웃 콘텐츠가 표시되므로 콘텐츠는 스크롤 할 수있는 _ 도구 모음 아래에 있습니다. [This] (https://gist.github.com/gamebusterz/151c06bad35aadd2c86f4fd6061220cf)는 내가 한 일입니다. – Yankee

+0

'TabLayout'을 사용해야합니까? 내 레이아웃에는 아무 것도 필요하지 않기 때문에. – Yankee

관련 문제