두 개의 TextView가 있습니다. 첫 번째 것이 너무 길면 두 번째 것이 사라집니다. 나는 android:layout_alignParentRight="true"
으로 RelativeLayout을 시도했지만 실제로는 그렇지 않습니다.첫 번째 TextView가 너무 길면 두 번째 디 서퍼
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/list_margin"
android:text="@string/movie_title"
android:textColor="#FFFFFF"
android:textSize="22sp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/textView1"
android:layout_marginLeft="@dimen/list_margin"
android:text="@string/new_sounds"
android:textColor="#8C1717"
android:textSize="13sp"
android:visibility="1"/>
</RelativeLayout>
첫째 텍스트 뷰는 영화 제목과 가끔 보이는 다른 텍스트가있을 것입니다 ListView에 단일 행의 레이아웃이 될 것. 그러나, 내가 말했듯이, 영화 제목이 길 때 textView2
은 화면에 보이지 않습니다. 첫 번째 텍스트가 끝나는 곳에서 처리하려면 어떻게해야합니까 (예 : 두 번째 줄에서 끝나면 옆에 textView2
이 표시됨)
변경 안드로이드를 공유 할 수 있습니다에 layout_alignParentLeft는 = "true"로 textView1. 이것은 트릭을해야합니다. 작동하는지 기록하십시오. –
아닙니다. 전체적으로'android : layout_weight'로 LinearLayout을 만들었습니다. 내가 원한 것이 아니지만 잘 작동합니다. – Roval