比率1対1のImageViewを横幅いっぱい使って、3つ横に並べるよう配置したく、
ConstraintLayoutで以下のようにすれば実現出来るかと思ったのですが、描画されません。
プログラム側で画面幅を取得して、3で割ってwidthを指定しないと実現できないのでしょうか?
よろしくおねがいいたします。
xml
1 <android.support.constraint.ConstraintLayout 2 android:layout_width="match_parent" 3 android:layout_height="wrap_content" 4 > 5 6 <TextView 7 android:id="@+id/title" 8 android:layout_width="wrap_content" 9 android:layout_height="wrap_content" 10 app:layout_constraintStart_toStartOf="parent" 11 app:layout_constraintTop_toTopOf="parent" 12 tools:text="タイトル" 13 /> 14 15 <ImageView 16 android:id="@+id/image_view_1" 17 android:layout_width="0dp" 18 android:layout_height="0dp" 19 app:layout_constraintBottom_toBottomOf="parent" 20 app:layout_constraintDimensionRatio="w,1:1" 21 app:layout_constraintEnd_toStartOf="@+id/image_view_2" 22 app:layout_constraintHorizontal_chainStyle="spread_inside" 23 app:layout_constraintHorizontal_weight="1" 24 app:layout_constraintStart_toStartOf="parent" 25 app:layout_constraintTop_toBottomOf="@+id/title" 26 /> 27 28 <ImageView 29 android:id="@+id/image_view_2" 30 android:layout_width="0dp" 31 android:layout_height="0dp" 32 app:layout_constraintBottom_toBottomOf="parent" 33 app:layout_constraintDimensionRatio="w,1:1" 34 app:layout_constraintEnd_toStartOf="@+id/image_view_3" 35 app:layout_constraintHorizontal_weight="1" 36 app:layout_constraintStart_toEndOf="@+id/image_view_1" 37 app:layout_constraintTop_toBottomOf="@+id/title" 38 /> 39 40 <ImageView 41 android:id="@+id/image_view_3" 42 android:layout_width="0dp" 43 android:layout_height="0dp" 44 app:layout_constraintBottom_toBottomOf="parent" 45 app:layout_constraintDimensionRatio="w,1:1" 46 app:layout_constraintEnd_toEndOf="parent" 47 app:layout_constraintHorizontal_weight="1" 48 app:layout_constraintStart_toEndOf="@+id/image_view_2" 49 app:layout_constraintTop_toBottomOf="@+id/title" 50 /> 51 52 </android.support.constraint.ConstraintLayout>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/05 05:37
2018/06/05 05:41
2018/06/05 06:00
2018/06/05 06:52
2018/06/05 07:13
2018/06/05 07:25
2018/06/05 07:32
2018/06/05 08:26
2018/06/05 10:00
2018/06/05 11:11