Android

Android studio_ 0-1. Flow

아이른 2024. 4. 3. 21:05

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" />