4

아래 주어진 내 프로필 페이지에서 Jake Wharton의 CirclePageIndicator을 사용하고 있습니다.AppBarLayout fitsSystemWindows true attr가 CircularIndicator를 보이지 않게합니다.

이미지 컨테이너는보기 페이지이며 아래쪽에 원 표시기가 표시됩니다.

그리고 appbar의 fitsSystemWindows attr을 statusbarcrim 작업을 수행하는 버그 afaik에 맞게 설정해야했습니다. 그러나이 attr circlePagerIndicator를 사용할 때 사라집니다. 사전에 UR 도움을

감사)

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

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsing_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:titleEnabled="false" 
     app:contentScrim="@color/colorPrimary" 
     app:statusBarScrim="@color/colorPrimaryDark" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed"> 

     <RelativeLayout 
      app:layout_collapseMode="none" 
      android:layout_width="match_parent" 
      android:layout_height="400dp"> 

      <android.support.v4.view.ViewPager 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:id="@+id/photo_pager"/> 

      <com.indate.indicator.CirclePageIndicator 
       android:id="@+id/indicator" 
       android:padding="10dip" 
       android:layout_height="wrap_content" 
       android:layout_width="match_parent" 
       android:layout_alignBottom="@+id/photo_pager" 
       /> 

     </RelativeLayout> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      app:layout_collapseMode="pin" 
      android:background="@android:color/transparent" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 

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

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

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fab" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    app:elevation="6dp" 
    app:layout_anchor="@id/app_bar_profile" 
    app:layout_anchorGravity="bottom|right|end" 
    app:rippleColor="@color/colorAccentRipple" 
    android:layout_margin="@dimen/fab_margin" 
    android:src="@android:drawable/ic_menu_edit"/> 


<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    > 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_margin="@dimen/activity_horizontal_margin"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:textSize="18sp" 
      android:paddingBottom="8dp" 
      android:text="John Doe" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingBottom="8dp" 
      android:text="1 dk önce" /> 


     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingTop="8dp" 
      android:textColor="?colorAccent" 
      android:textSize="12sp" 
      android:text="ABOUT ME" /> 


     <TextView 
      android:id="@+id/text_about_me" 
      android:paddingTop="8dp" 
      android:paddingBottom="8dp" 
      android:text="Simply me, nothing more..." 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"/> 


     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="8dp" 
      android:textColor="?colorAccent" 
      android:textSize="12sp" 
      android:text="OVERVIEW" /> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical"> 

      <ImageButton 
       android:layout_width="24dp" 
       android:layout_height="24dp" 
       android:background="@android:color/transparent" 
       android:src="@drawable/gender"/> 

      <TextView 
       android:id="@+id/text_gender_age" 
       android:padding="8dp" 
       android:text="M, 28" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"/> 

     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical"> 

      <ImageButton 
       android:layout_width="24dp" 
       android:layout_height="24dp" 
       android:background="@android:color/transparent" 
       android:src="@drawable/pin"/> 

      <TextView 
       android:id="@+id/text_place" 
       android:padding="8dp" 
       android:text="Ankara, Turkey" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"/> 

     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical"> 

      <ImageButton 
       android:layout_width="24dp" 
       android:layout_height="24dp" 
       android:background="@android:color/transparent" 
       android:src="@drawable/logo"/> 

      <TextView 
       android:id="@+id/text_member_since" 
       android:padding="8dp" 
       android:text="Member since May 2012" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"/> 

     </LinearLayout> 

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

답변

1

AppBarLayout 안드로이드 : = "true"를 어떻게 든 CollapsingToolbarLayout 내부 RelativeLayout의와는 혼란하게 fitsSystemWindows. 버그가있는 것 같습니다. 그래서 그것을 제거하고 그것은 매력처럼 작동했습니다.

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

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsing_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:titleEnabled="false" 
     app:contentScrim="@color/colorPrimary" 
     app:statusBarScrim="@color/colorPrimaryDark" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed"> 


     <android.support.v4.view.ViewPager 
      android:layout_width="match_parent" 
      android:layout_height="400dp" 
      android:id="@+id/photo_pager"/> 

     <com.indate.indicator.CirclePageIndicator 
      android:id="@+id/indicator" 
      android:padding="10dip" 
      android:layout_height="wrap_content" 
      android:layout_width="match_parent" 
      android:layout_gravity="bottom" 
      /> 


     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      app:layout_collapseMode="pin" 
      android:background="@android:color/transparent" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 

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

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

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fab" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    app:elevation="6dp" 
    app:layout_anchor="@id/app_bar_profile" 
    app:layout_anchorGravity="bottom|right|end" 
    app:rippleColor="@color/colorAccentRipple" 
    android:layout_margin="@dimen/fab_margin" 
    android:src="@android:drawable/ic_menu_edit"/> 


<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    > 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_margin="@dimen/activity_horizontal_margin"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:textSize="18sp" 
      android:paddingBottom="8dp" 
      android:text="John Doe" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingBottom="8dp" 
      android:text="1 dk önce" /> 


     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingTop="8dp" 
      android:textColor="?colorAccent" 
      android:textSize="12sp" 
      android:text="ABOUT ME" /> 


     <TextView 
      android:id="@+id/text_about_me" 
      android:paddingTop="8dp" 
      android:paddingBottom="8dp" 
      android:text="Simply me, nothing more..." 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"/> 


     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="8dp" 
      android:textColor="?colorAccent" 
      android:textSize="12sp" 
      android:text="OVERVIEW" /> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical"> 

      <ImageButton 
       android:layout_width="24dp" 
       android:layout_height="24dp" 
       android:background="@android:color/transparent" 
       android:src="@drawable/gender"/> 

      <TextView 
       android:id="@+id/text_gender_age" 
       android:padding="8dp" 
       android:text="M, 28" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"/> 

     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical"> 

      <ImageButton 
       android:layout_width="24dp" 
       android:layout_height="24dp" 
       android:background="@android:color/transparent" 
       android:src="@drawable/pin"/> 

      <TextView 
       android:id="@+id/text_place" 
       android:padding="8dp" 
       android:text="Ankara, Turkey" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"/> 

     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical"> 

      <ImageButton 
       android:layout_width="24dp" 
       android:layout_height="24dp" 
       android:background="@android:color/transparent" 
       android:src="@drawable/logo"/> 

      <TextView 
       android:id="@+id/text_member_since" 
       android:padding="8dp" 
       android:text="Member since May 2012" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"/> 

     </LinearLayout> 

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