0

Я использовал CollapsingToolbarLayout какое-то время, и он всегда работал. С обновлением доПараллакс-эффект в CollapsingToolbarLayout больше не работает в buildToolsVersion «24.0.2»

compileSdkVersion 24 
buildToolsVersion "24.0.2" 

он больше не работает, как ожидалось. Относительная компоновка отображается правильно в строке состояния, но содержимое внутри относительного макета отображается ниже строки состояния (например, изображения, тексты и т. Д.). Если я добавлю цвет фона, я вижу, что относительный макет отображается просто отлично. Почему содержимое относительной компоновки больше не соответствует его родителям после изменения новой библиотеки дизайна?

Это мой макет:

<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" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true"> 


<android.support.design.widget.AppBarLayout 
    android:id="@+id/appBar" 
    android:layout_width="match_parent" 
    android:layout_height="@dimen/detail_backdrop_height" 
    android:fitsSystemWindows="true" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    android:transitionName="@string/transition_properly_list"> 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsing_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     app:collapsedTitleTextAppearance="@style/CollapsedAppBar" 
     app:contentScrim="?attr/colorPrimary" 
     app:expandedTitleMarginEnd="64dp" 
     app:expandedTitleMarginStart="48dp" 
     app:expandedTitleTextAppearance="@style/transparentText" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed"> 





     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_collapseMode="parallax" 
      android:fitsSystemWindows="true" 
      > 

      <ImageView 
       android:id="@+id/backdrop" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:scaleType="centerCrop" 
       android:src="@drawable/genericproperty" 

       /> 

      <ImageView 

       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:background="@color/transparentBlack" 
       android:scaleType="centerCrop"/> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_centerVertical="true" 
       android:gravity="center_vertical" 
       android:orientation="vertical" 
       android:paddingTop="50dp"> 

       <TextView 
        android:id="@+id/txtTitle" 
        style="@style/extraLargeWhite" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center_horizontal" 
        android:layout_marginBottom="@dimen/activity_margin" 
        android:gravity="center_horizontal" 
        android:text="2234 Mission Street"/> 

       <TextView 
        android:id="@+id/txtSpareSubtitle" 
        style="@style/largeWhite" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="@dimen/activity_margin" 
        android:gravity="center_horizontal" 
        android:text="San Francisco, CA" 
        android:visibility="gone"/> 
       <TextView 
        android:id="@+id/txtSubtitle" 
        style="@style/largeWhite" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="@dimen/activity_margin" 
        android:gravity="center_horizontal" 
        android:text="San Francisco, CA" 
        android:visibility="visible"/> 



       <TextView 
        android:id="@+id/txtDetails" 
        style="@style/mediumWhite" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:gravity="center_horizontal" 
        android:text="a lot of rooms everywhere"/> 

      </LinearLayout> 

     </RelativeLayout> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:title="" 
      app:layout_collapseMode="pin" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/> 
     </android.support.v7.widget.Toolbar> 

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

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

<android.support.v4.widget.SwipeRefreshLayout 
... 

Спасибо за любую помощь! Приветствия

ответ

0

В моем случае проблема была в какой-то невидимый элемент в collapsingToolbar, поэтому постарайтесь, чтобы удалить все

android:visibility="gone" 

 Смежные вопросы

  • Нет связанных вопросов^_^