Mobile/Android
자주 사용되는 속성들 (match_parent, wrap_content, orientation vertical)
악역영애
2024. 1. 8. 18:23
반응형
TextView
html 의 p태그와 비슷하며, 텍스트를 입력할 수 있다
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="소개팅 앱!!"
/>
match_parent : 부모요소의 길이
예제를 기준으로, textView 상위 부모의 width 를 따라간다
wrap_content : 해당요소의 길이
예제를 기준으로, text 요소의 height를 입력한다
LinearLayout
여러 요소를 줄세우는 div
세로, 가로 가능
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
tools:layout_editor_absoluteX="0dp">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/mainColor"
android:layout_margin="10dp"
android:textColor="@color/white"
android:text="Login" />
</LinearLayout>
orientation = vertical : 세로정렬
728x90