0

collapsible toolbar은 작동하지만, nestedscrollview을 사용하여 위로 스크롤하려고 했으므로 제목을 덮습니다. 나는 그것을 상대적 배치에 넣으려고했으나 toolbar은 작동을 멈추었고 이제는 더 이상 쓰러지지 않을 것입니다.코디네이터 레이아웃 내부에서 뷰를 정렬하는 방법은 무엇입니까?

은 여기 내 레이아웃

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/cordinator" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="#fff" 
    tools:context="com.store.android.basic.Introduction"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/app_bar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <include 
      android:id="@+id/introduction_toolbar" 
      layout="@layout/app_toolbar" /> 

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

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 


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

      <TextView 
       android:id = "@+id/title" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="10dp" 
       android:text="@string/heading" 
       android:textColor="#D31F33" 
       android:textSize="25sp" 
       android:textStyle="bold" /> 

      <TextView 
       android:id = "@+id/sub_title" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:text="@string/text_one" 
       android:textSize="18sp" /> 
     </LinearLayout> 
    </android.support.v4.widget.NestedScrollView> 
</android.support.design.widget.CoordinatorLayout> 

답변

1

응용 프로그램입니다 : layout_behavior = "@ 문자열/appbar_scrolling_view_behavior"

은 그냥 NestedScrollView에이 줄을 넣어.

관련 문제