
<?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:id="@+id/constraintlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="@drawable/linearlayout_horizontal_line"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:text="군 도"
android:textSize="25dp"
app:layout_constraintRight_toLeftOf="@id/ic_15"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/view" />
<ImageView
android:id="@+id/ic_15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/view"
android:layout_marginTop="15dp"
android:src="@drawable/ic_15"/>
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:background="@drawable/linearlayout_horizontal_line"
app:layout_constraintTop_toBottomOf="@id/title"/>
ConstraintLayout 사용하는걸 연습하라하셔서 지금 버튼 클릭시 화면띄우는게 하나있는데
그걸 ConstraintLayout으로 만들어볼까 해서 만들고 있거든요..
근데 사진만큼 만들었는데 코드는 저만큼 양이 나옵니다..
가성비가 안좋다고해야하나요.. constraintRight_toRightof 이런 속성들을 하나하나 넣어서
부모 아래 배치, 어느 뷰 옆에 배치, 아래배치 등 이런걸 다 연결해서 하다보니까
뷰하나에도 코드 3~4줄이 자꾸들어가던데 원래이런건가요..?
군도,15 부분 보시면 수평배치이기때문에 Linearlayout이 더 좋지 않을까 했는데
그냥 Contraintlayout으로 뷰끼리 연결을 했는데 넘 비효율적이죠?...
Linearlayout이랑 Relatilayout 보다 Contraintlayout 많이 연습하라고 하셔서 안쓰려고했는데 말이죠...
Linearlayout이랑 Relatilayout도 쓸때에는 써줘야할까요