2

は、現在のプロファイルpicがConstraintLayoutの一部であり、残念ながら、それは重複していますAppBarLayout折りたたみツールバーのレイアウトと制約レイアウト

どのようにそれを達成するためのアイデア? は、私が実際に最近、この

について考え始めそして、ここでのAndroidの背後にある開発者の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.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/playerViewBg" 
     android:fitsSystemWindows="false"> 

     <android.support.design.widget.CollapsingToolbarLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

      <ImageView 
       android:id="@+id/bgIV" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:adjustViewBounds="true" 
       android:scaleType="centerCrop" 
       android:src="@drawable/header_bg" /> 

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

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

    <android.support.constraint.ConstraintLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <ImageView 
      android:id="@+id/playerIV" 
      android:layout_width="177dp" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:layout_marginTop="62dp" 
      android:adjustViewBounds="true" 
      android:scaleType="fitCenter" 
      android:src="@drawable/profilePic" 
      app:layout_constraintEnd_toStartOf="@+id/guideline2" 
      app:layout_constraintLeft_toLeftOf="parent" 
      app:layout_constraintRight_toRightOf="parent" 
      app:layout_constraintStart_toStartOf="@+id/guideline" 
      app:layout_constraintTop_toTopOf="parent" /> 

     <!-- Other content --> 

     <android.support.constraint.Guideline 
      android:id="@+id/guideline" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      app:layout_constraintGuide_percent="0.27" /> 

      <android.support.constraint.Guideline 
      android:id="@+id/guideline2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      app:layout_constraintGuide_percent="0.73" /> 

    </android.support.constraint.ConstraintLayout> 

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

答えて

2

.....レイアウトの私の組み合わせに関する任意のソースを見つけることができませんメーカー: https://www.youtube.com/watch?v=8lAXJ5NFXTM(21分で28秒マーク)

Nicol's demo

それは間違いなく可能であり、彼らはCollapsingToolbarLayoutのcompletの交換をお勧めしますConstraintLayoutでelyを設定します。

+0

10x私はそれが有望に見えます:)実際に私は崩壊に制約を移動する問題を解決しました。 –

+0

@ JockyDoeもう少し説明できますか?どのように問題を解決したかについて –

+0

@LOG_TAG –

関連する問題