2

각 항목에 대해 다음 XML을 사용하여 목록보기를 채우는 ListActivity가 있습니다.RelativeLayout - TextView가 표시되지 않습니다.

누구나 제 3 행을 시간 이름으로 표시하지 않을 수 있습니까?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" android:layout_height="100dip" 
android:padding="6dip" android:id="@+id/result_item" android:background="#000000"> 

<TextView android:id="@+id/rule" android:layout_marginLeft="55dip" 
    android:layout_width="fill_parent" android:layout_height="26dip" 
    android:layout_toRightOf="@+id/imgview" android:textAppearance="?android:attr/textAppearanceMedium" 
    android:gravity="bottom" android:text="Rule....." /> 

<TextView android:id="@+id/accuracy" android:layout_width="fill_parent" 
    android:layout_height="26dip" android:layout_below="@+id/rule" 
    android:layout_alignLeft="@id/rule" android:layout_alignParentBottom="true" 
    android:gravity="top" android:text="Accuracy" /> 

<TextView android:id="@+id/time_window" android:layout_width="fill_parent" 
    android:layout_height="26dip" android:layout_below="@+id/accuracy" 
    android:layout_alignLeft="@id/rule" android:layout_alignParentBottom="true" 
    android:gravity="top" android:text="time window..." /> 

<ImageView android:id="@+id/imgmine" android:layout_width="38px" 
    android:layout_height="38px" android:layout_gravity="center_vertical" 
    android:src="@drawable/mine" /> 
     </RelativeLayout> 

답변

4

두 번째보기의 높이 공간은 모두 android:layout_alignParentBottom="true"입니다. 해당 문을 제거하면 문제가 해결됩니다.

그런데 Android SDK에있는 hierarchyviewer도 사용하는 것이 좋습니다. 뷰를 작성하는 방법을보고 이러한 종류의 오류를 감지 할 수 있습니다.

+0

그래서 마지막 뷰에는 alignParentBottom 만 있어야합니까? 그렇다면 문제가 해결되었습니다 .- 건배! – kkudi

관련 문제