2016-08-13 5 views
0

This is what I want안드로이드 AppBarLayout

This is what it looks like

1 내가 보관하고 싶은,하지만 그것은 기압처럼 보이는 것은 내가 거의 모든 솔루션을 시도 2

<?xml version="1.0" encoding="utf-8"?> 
 
<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:orientation="vertical" 
 
    android:fitsSystemWindows="true"> 
 

 
    <android.support.design.widget.AppBarLayout 
 
     android:id="@+id/appbar" 
 
     android:layout_width="match_parent" 
 
     android:layout_height="wrap_content" 
 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
 
     android:fitsSystemWindows="true"> 
 
     <android.support.v7.widget.Toolbar 
 
      android:id="@+id/toolbar" 
 
      android:layout_width="match_parent" 
 
      android:layout_height="?attr/actionBarSize" 
 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
 
      app:title="Edit Profile" 
 
      app:titleTextColor="@android:color/white" /> 
 
    </android.support.design.widget.AppBarLayout> 
 

 

 
    <android.support.v4.widget.NestedScrollView 
 
     android:layout_width="match_parent" 
 
     android:layout_height="match_parent" 
 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"> 
 
      ..... 
 
    </android.support.v4.widget.NestedScrollView> 
 

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

무엇이다 스택 오버플로,

예 :

<item name="android:windowDrawsSystemBarBackgrounds">true</item>

fitsSystemWindows="true"

그리고 더 많은 ..

나는 그것이 어려운해야한다고 생각하지 않습니다. 제안이나 예제 프로젝트가 좋습니다.

+0

모든 'android : fitsSystemWindows = "true"'를 제거하려고 시도 했습니까? –

+0

'android : fitsSystemWindows = "true"'를'CoordinatorLayout'에서만 제거해보십시오. –

+0

'android : fitsSystemWindows = "true"를 양쪽 모두에서 제거하려고 시도하고,'CoordinatorLayout'과'AppBarLayout'에서만 모든 조합이 레이아웃에 영향을 미치지 않았습니다. –

답변

0

방금 ​​알아 냈지만 어떻게해야할지 모르겠다.

전에 가능한 모든 조합을 시도했지만 어느 조합도 작동하지 않았지만 레이아웃을 변경 한 후에 갑자기 수정되었습니다.

나는 모든 코드 변경 라인 인 을 추적했고 AppBarLayout에서 android:fitsSystemWindows="true" 옵션을 제거해야한다고 판명되었습니다.

전에 3 번이나 똑같은 것을 시도했기 때문에 정말 이상하지만, 레이아웃에는 아무런 영향이 없었습니다. 누군가가 저와 비슷한 문제로 고통 경우

, 내가 1. clean project 2. remove the layout entirely and put it back 실제 변경을

내가보고 추천 할 것입니다 나는 그것이 아마 캐싱 문제 나 다시 짜증나는 안드로이드 스튜디오에 대한 몇 가지 버그 생각

.. 이 문제에 대해 약 5 시간을 낭비했으며 강의는 단지 "Android Studio를 신뢰하지 마십시오"

0

세바스찬 나는 fitssystemwindows 속성으로 놀고 난 후에도 같은 문제를 안고있었습니다. 나는 내가 한 일을 정확하게 기억하지 못하고 그 속성이 무엇 인지도 모릅니다. 따라서 fitssystemwindows를 추가/제거하는 다양한 조합을 시도해 볼 수 있습니다. 예를 들어, appbarlayout에서 제거하고 무슨 일이 일어나는 지보십시오.

+0

모든 가능한 조합을 시도했지만'fitssystemwindows' 속성을 변경해도 레이아웃에는 전혀 영향을 미치지 않습니다. –

+0

nestedscroll에 속성이 더 있습니까? 당신은 그들에게 – user6650650

+0

을 게시 할 수 있습니까? nope nestedscroll은 질문에서 그 속성들을 가지고 있습니다. –

관련 문제