<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sl="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<ImageView
android:layout_width="match_content"
android:layout_height="0dp"
android:layout_weight="5"
android:id="@+id/diagnostic_image"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:id="@+id/diagnostic_text"
android:textColor="@color/black"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
일단 맨 위 Layout 은 : RelativeLayout 으로 지정 하였구요,
layout_width 와 layout_height 는 match_parent 로 지정 하였습니다.
그 아래 LinearLayout 으로 orientation 을 vertical 로 하고, weightSum 을 10 으로 주었습니다.
두 Layout 사이에 CardView 가 있어서 따로 선언해 주었습니다.
LinearLayout 하위에 ImageView 와 TextView 가 있는데, 문제는 TextView 의 내용, 즉, text 의 양이 일정치 않아
layout 의 크기를 가변적으로 만들어야 되는데 잘 모르겠네요ㅜ..
ImageView 와 TextView 는 layout_weight 를 각각 5 로 지정하여 Layout 을 2등분 하게 만들었습니다.
종합해서, text 의 양에 따라 크기를 가변적으로 만들고 싶은데 어떻게 해야 될까요??