Flow
- constraintLayout의 사용을 지향하면서 LinearLayout이 그리울 때 사용
- 지정 된 아이디의 위젯을 정렬
- android: orientation = "vartical" : 제약을 걸어준 위젯들의 수직, 수평
- app: flow_vaticalGap = "20dp" : 수직(수평)의 사이의 간격
- app: constraint_referenced_ids = "제약을 걸어줄 아이디" : Flow 안에 위젯을 직접 넣지 않음
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/myPageFlow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="myPageImageView, myPageTextView"
//정렬하고 싶은 아이디 지정
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/divideLine"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="20dp"
android:orientation="vertical"/>
//수직, 수평 지정
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/myPageImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/baseline_account_box_36" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/myPageTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MY"
android:textStyle="bold"
tools:ignore="MissingConstraints" />
'Android' 카테고리의 다른 글
Android Studio_ 8. Fragment (프래그먼트) (1) | 2024.04.18 |
---|---|
Android studio_ 0-2. CardView & CircleImageView (0) | 2024.04.05 |
Android studio_ 1-2. Intent와 data class (0) | 2024.04.03 |
Android Studio_ 8. Spinner (0) | 2024.03.29 |
Android Studio_ 7-1. View binding (0) | 2024.03.28 |