나는 이와 같은 상대 뷰를했습니다 :텍스트 길이에 따라 상대 레이아웃의 크기를 동적으로 늘리는 방법은 무엇입니까?
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linkCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@layout/login_gradient_bg"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:background="@drawable/card_bg">
<TextView
android:id="@+id/linkTitle0001"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/faviconView0001"
android:paddingLeft="4dp"
android:lineSpacingExtra="-2dp"
android:fontFamily="sans-serif-condensed"
android:maxLines="2"
android:text="@string/link_title_001"
android:textColor="#717171"
android:textSize="17sp" />
<TextView
android:id="@+id/linkDesc0001"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/faviconView0001"
android:paddingBottom="4dp"
android:fontFamily="sans-serif"
android:maxLines="1"
android:text="@string/link_desc_001"
android:textColor="#acacac"
android:textSize="13sp" />
<ImageView
android:id="@+id/faviconView0001"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dp"
android:paddingBottom="7dp"
android:src="@drawable/favicon_example" />
<ImageView
android:id="@+id/labelSource0001"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/linkDesc0001"
android:background="@drawable/card_label" />
</RelativeLayout>
</FrameLayout>
내가 linkTitle0001 텍스트 뷰에 가득 텍스트의 길이는 RelativeLayout의의 크기를 증가하고 싶었다. 어떻게해야합니까?
높이를 콘텐츠를 줄 바꾸기로 설정하고 텍스트보기의 높이를 콘텐츠를 줄 바꿈으로 설정했습니다. 따라서 더 큰 문자열을 넣으면 텍스트에 맞게 자동으로 증가해야합니다. 아니면 뭔가 다른 것을 의미 했습니까? –
네, 그 뜻입니다. 그러나 전혀 일어나지 않습니다. – Hick
무슨 일입니까? 스크린 샷이 도움이 될 것입니다. –