Android约束布局ConstraintLayout流式Flow
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<androidx.cardview.widget.CardView
android:layout_width="100dp"
android:layout_height="100dp"
app:cardBackgroundColor="@android:color/holo_orange_light"
app:cardCornerRadius="50dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/ic_launcher_foreground" />
</androidx.cardview.widget.CardView>
<androidx.constraintlayout.helper.widget.Flow
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:constraint_referenced_ids="tv1,tv2,tv3,tv4,tv5,tv6,tv7"
app:flow_horizontalGap="10dp"
app:flow_verticalGap="20dp"
app:flow_wrapMode="aligned"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_green_dark"
android:text="1" />
<TextView
android:id="@+id/tv2"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_orange_light"
android:text="2" />
<TextView
android:id="@+id/tv3"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_red_dark"
android:text="3" />
<TextView
android:id="@+id/tv4"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_green_light"
android:text="4" />
<TextView
android:id="@+id/tv5"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_blue_light"
android:text="5" />
<TextView
android:id="@+id/tv6"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_green_dark"
android:text="6" />
<TextView
android:id="@+id/tv7"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:background="@android:color/holo_red_light"
android:text="7" />
</androidx.constraintlayout.widget.ConstraintLayout>
Android约束布局ConstraintLayout的Guideline,CardView-CSDN博客Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。https://blog.csdn.net/zhangphil/article/details/133350654
Android ConstraintLayout layout_constraintHorizontal layout_constraintDimensionRatio square CardView-CSDN博客Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。Android ConstraintLayout约束布局的居中_android constraintlayout 两个图片并排水平居中-CSDN博客。Android ConstraintLayout按比例缩放View_constraintlayout 比例-CSDN博客。https://blog.csdn.net/zhangphil/article/details/133324821
Android ConstraintLayout app:layout_constraintHorizontal_weight-CSDN博客Android ConstraintLayout按比例缩放View关键点有两个,第一,使用Android ConstraintLayout的layout_constraintDimensionRatio属性,设置宽高比缩放比例,宽:高。Android ConstraintLayout约束布局的居中_android constraintlayout 两个图片并排水平居中-CSDN博客。Android ConstraintLayout按比例缩放View_constraintlayout 比例-CSDN博客。https://blog.csdn.net/zhangphil/article/details/133323625