2016-10-11 4 views
1

내 조각 내에서 축소 된 레이아웃을 구현하고 싶습니다. 내 CollapsingLayout, framelayout (container) 및 tablayout은 프레임 레이아웃에 배치 된 것처럼 배치됩니다.
Collapsinglayout을 맨 아래에 만들고, 아래의 tablayout 및 프레임 레이아웃 conteiner를 tablayout 아래에 만들고, 축소 형 주석을 유지하려고합니다. coordinatorLayout에서 레이아웃을 수직으로 배치하는 방법

fragment_layout.xml (프레임 레이아웃 컨테이너 [때문에 varioius 맞춤 제스처 viewpager 고려하지의] recyclerview 이루어진 다양한 단편 호스트)

<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:background="@color/appBgColor" 
    android:clickable="true" 
    tools:context="com.lunchpoint.fragments.RestaurantFragment" 

    > 
    <android.support.design.widget.AppBarLayout 
     android:id="@+id/id_appbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@android:color/transparent" 
     android:fitsSystemWindows="true" 
     > 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     app:contentScrim="?attr/colorPrimary" 
     app:expandedTitleMarginEnd="64dp" 
     app:expandedTitleMarginStart="48dp" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed" 
     > 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="310dip" 
      > 
     <!--Header layout--> 
     </RelativeLayout> 

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

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

     android:layout_marginEnd="16dip" 
     android:layout_marginLeft="16dip" 
     android:layout_marginRight="16dip" 
     android:layout_marginStart="16dip" 
     app:tabGravity="fill" 
     app:tabMinWidth="0dip" 
     app:tabMode="scrollable" 
     app:tabPaddingEnd="1dp" 
     app:tabPaddingStart="1dp" 
     /> 

    <FrameLayout 

     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     /> 

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

답변

0

CoordinatorLayout이 전동 FrameLayout이있다 : 모든 차일 자신의 위치를 ​​정의 할 수있다 행동이나 닻을 통해 this과 같은 더 많은 문서를보세요.

관련 문제