我嘗試做佈局有兩個TextView的和一個線性佈局:如何修復LineLayout的最後一個元素,使其不超出屏幕邊界?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/holo_orange_dark"
android:text="testsdddddddddddddddddddddddddddasdsdfsdfsdf"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_red_dark"
android:maxLines="1"
android:text="NOT HIDE TEXT"/>
</LinearLayout>
但是,當第一個元素有許多字符第二個文本是hidding。 但我想這樣做: 當第一個文本短(或第二元素可以全部不填aviliable區): 我可怎麼辦呢?可能是我需要使用RelativeLayout? 非常感謝您的回答)
爲了什麼?我希望第二個元素不要縮小並且在屏幕後面。 –
如果你想要第二個佈局使用而不是Relative和LinearLayout,它們將不起作用。 –
你能寫例子嗎? –