0

접을 수있는 레이아웃을 사용하고 있습니다. 여기에는 기본 레이아웃이 있습니다.Android 접이식 레이아웃이 제대로 작동하지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" 
               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:fitsSystemWindows="true" 
               tools:context=".MainActivity"> 

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

     <android.support.design.widget.CollapsingToolbarLayout 
      android:id="@+id/collapse_toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_scrollFlags="scroll|exitUntilCollapsed" 
      android:fitsSystemWindows="true"> 

     <ImageView 
      android:id="@+id/bgheader" 
      android:layout_width="match_parent" 
      android:layout_height="300dp" 
      android:scaleType="centerCrop" 
      android:fitsSystemWindows="true" 
      android:background="@drawable/scenary" 
      app:layout_collapseMode="parallax" /> 


     <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
              xmlns:attrs="http://schemas.android.com/apk/res-auto" 
              xmlns:app="http://schemas.android.com/apk/res-auto" 
              android:id="@+id/toolbar" 
              android:layout_width="match_parent" 
              android:layout_height="?attr/actionBarSize" 
              android:background="?attr/colorPrimary" 
              app:layout_scrollFlags="scroll|enterAlways" 
              app:popupTheme="@style/AppTheme.PopupOverlay"> 

      <FrameLayout 
       android:id="@+id/titleContainer" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 

       android:gravity="center"> 
       <.utils.CustomFontTextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:gravity="center" 
        android:text="Toolbar Title" 
        android:textColor="#ffffff" 
        attrs:customFont="handyman_bold" 
        android:textSize="8pt" 
        android:layout_marginLeft="-20dp" 
        android:id="@+id/toolbar_title"/> 
      </FrameLayout> 

      <ImageButton 
       android:id="@+id/btn_ToolBarRightBtn" 
       android:layout_width="32dp" 
       android:layout_height="28dp" 
       android:tag="0" 
       android:background="@null" 
       android:scaleType="fitXY" 
       android:src="@drawable/icon_shopping" 
       android:layout_alignParentRight="true" 
       android:layout_gravity="right" 
       android:layout_marginRight="10dp" 
       /> 



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

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

    <android.support.v4.view.ViewPager 
     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"/> 
    <android.support.design.widget.TabLayout 
     android:id="@+id/tabs" 
     android:layout_gravity="bottom" 
     android:background="@color/offwhite" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"/> 

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

ViewPager 안에는 리사이클 러 뷰가 있습니다. 여기에 내가 응용 프로그램을로드 할 때 내가 격차를 볼 이유

나는이 메시지가 표시되는 리사이클보기를 스크롤

enter image description here

,

enter image description here

나는 확실하지 않다, 무엇을보고있다 처음에는 나중에 앱 기본 색상으로 채워집니다. 내가 여기서 뭐하고 있니?

내 화면의 애니메이션 GIF가 첨부되었습니다.

enter image description here

감사

+0

게시물에 appbarlayout을 래핑하는 코디네이터 레이아웃이 없습니다. – jayeshsolanki93

+0

업데이트 된 질문이 미안합니다. – Zach

+0

@ jayeshsolanki93 화면 흐름이 첨부되었습니다. – Zach

답변

1

하나의 간단한 해결책이 문제는 디자인 지원 라이브러리 23.2에 대해 어떻게 설계 지원 라이브러리 버전 23.1.1을 사용하는 것입니다 없습니다 있습니다. 0 이상.

compile 'com.android.support:design:23.1.1' 

번째 해결책은 CoordinatorLayout에서 android:fitsSystemWindows="true" 라인을 제거한다.

UPDATE : 두 경우

툴바가 이미지를 중첩되므로, 상태 막대 아래 부분이 보이지

CollapsingToolbarLayout 클래스 FrameLayout의 자식이기 때문에 일어나고 . 그래서 framelayout에서 전달하는 견해는 서로 쌓일 것입니다. 그것이 툴바가 이미지를 오버랩하는 이유입니다. 귀하가 찾은 가장 간단한 해결책은 을 ImageView에 넣는 것입니다.

+0

고마워요. yuor 솔루션이 작동합니다! 내 하루를 만들었 : D – Zach

+0

두 번째 옵션을 시도했지만 상태 표시 줄이 흰색으로 바뀌면 선을 제거 할 수 있습니다. 그 이유는 무엇입니까? 또한 두 경우 모두 툴바가 이미지와 겹치기 때문에 상태 표시 줄 아래의 부분이 보이지 않습니다. 어떻게 지울 수 있습니까? – Zach

+0

툴바 겹침 문제로 인해 업데이트되었습니다. –

0

당신의 FrameLayout이의 더 app:layout_behavior="@string/appbar_scrolling_view_behavior"

<FrameLayout 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    android:id="@+id/titleContainer" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
+0

감사합니다. 그러나 일하지 않았다. 여전히 동일한 – Zach

+0

콘텐츠 레이아웃으로 NestedScrollView로 둘러싸인 경우 –

관련 문제