这是我当前的 ListView 项目布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="6dp"
android:paddingRight="6dp"
android:paddingBottom="6dp">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="6dp">
<TextView
android:id="@+id/departure_line"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:singleLine="true"
android:textSize="16sp"
android:textStyle="bold"
android:shadowColor="#000000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:paddingLeft="3dp"
android:paddingRight="3dp" />
</RelativeLayout>
<TextView
android:id="@+id/departure_destination"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="52dp"
android:background="#777777"
android:singleLine="true"
android:ellipsize="end"
android:textSize="16sp" />
<TextView
android:id="@+id/departure_time"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:textSize="16sp" />
</RelativeLayout>
我的问题是目标 TextView 覆盖了时间 TextView,正如您在屏幕上看到的那样。如何预防?
最佳答案
在你的目的地使用 android:layout_toLeftOf="@+id/departure_time"或者你可以在 TableLayout 中设置它们>
关于android - RelativeLayout TextView 覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6087116/