这是我目前的ListView项目布局:的RelativeLayout的TextView覆盖
<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的,你可以在屏幕上看到。如何防止呢?
http://www.abload.de/image.php?img=screensk6y.png
要做到这一点的唯一方法是使用TableLayout,因为RelativeLayout总是在布局安排中覆盖TextView。 – CannyDuck 2011-06-03 22:04:49
事实上,只要你使用布局定义textView的边缘,它就会随时随地走到你想要的位置,高度/宽度将停止在你告诉它的位置 – KyleM 2012-05-09 01:40:09
谢谢你的回答!对于在问题中包含工作“覆盖”的问题提问者做得很好。这使得找到解决方案变得非常容易。 – 2012-06-20 16:44:40