Android

[안드로이드/View Widget] GuideLine 가이드 라인

nanee_ 2022. 2. 18. 15:02
728x90
반응형
SMALL
 

Guideline  |  Android Developers

 

developer.android.com

 

Guideline 가이드라인

화면을 구성하는 목적으로 쓰이는 가이드라인으로

개발을 할 때에만 보여지고, 사용자에게는 보여지지 않는 선이다.

 

뷰들을 선에 맞추어 배치해야할 경우에 가이드라인에 식별자 id 값을 부여해 사용한다.

부모 배치자로는 constraintLayout 이 올 수 있다.

 

 

사용 예시

<androidx.constraintlayout.widget.Guideline
    android:id="@+id/guideline1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    app:layout_constraintGuide_percent="0.3" />

<TextView
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:background="@color/black"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="@id/guideline1"
    app:layout_constraintTop_toTopOf="parent" />

 

 

 

 

728x90
반응형
LIST