Ngay bây giờ tôi có hai textViews một liên kết ở bên trái của bố cục tương đối và một căn chỉnh ở bên phải. Văn bản bên trái dài hơn nhiều so với bên phải. Trong một số trường hợp, văn bản bên trái là hai dòng. Khi điều này xảy ra, văn bản này chồng lên văn bản được căn chỉnh ở bên phải.Làm cách nào để ngăn các chế độ xem chồng chéo trong bố cục tương đối?
Có cách nào để ngăn điều này không? Hoặc có cách nào để nói nếu văn bản bên trái là hai dòng đặt văn bản ở bên phải trên dòng thứ hai?
Tôi đang gặp rắc rối với tên và thời gian xuống ở đây:
<RelativeLayout android:layout_width="wrap_content" android:id="@+id/relativeLayout" android:layout_height="wrap_content">
<TextView android:text="TextView" android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10sp" android:textStyle="bold" android:textSize="16sp"></TextView>
<TextView android:layout_width="wrap_content" android:id="@+id/address" android:text="address" android:layout_height="wrap_content" android:layout_below="@+id/name" android:layout_alignLeft="@+id/name" android:layout_marginLeft="30sp"></TextView>
<TextView android:layout_width="wrap_content" android:layout_toRightOf="@+id/address" android:text="" android:layout_height="wrap_content" android:layout_alignTop="@+id/address" android:layout_alignBottom="@+id/address" android:id="@+id/crossStreet"></TextView>
<TextView android:layout_width="wrap_content" android:id="@+id/time" android:text="Time" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginRight="10sp"></TextView>
</RelativeLayout>
tuyệt vời. nó đã làm việc. Tôi cũng làm cho thời gian căn chỉnh ở bên phải của bố trí tuyến tính, để tham khảo trong tương lai. – mergesort
Tôi có nên chơi với trọng lượng không? Tôi có 0,35 và .65 để làm cho nó hoạt động, nhưng .4 và .6 mang lại kết quả buồn cười – mergesort