This seems to be a simple question, but I cannot figure out how to do this.
I have a horizontal LinearView with something fixed in size on the left, and then some text appears that should take up as much space as possible, but there should be another object of a fixed size on the right.
Now my problems are now: when the text in the middle is too long, the object on the right is pushed out of the window. When the text is too short, it does not sit on the right border of the window, but directly next to the text.
How can i do this? My code is still (As you can see, I tried using LayoutWeight, which did not help ...):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/important"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
android:background="#000000"
android:layout_weight="1"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingLeft="0dp"
android:textColor="#333333"
android:paddingBottom="0dp"
android:textSize="14sp"
android:scrollHorizontally="true"/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#666666"
android:paddingTop="3dp"
android:paddingRight="5dp"
android:paddingLeft="10dp"
android:paddingBottom="5dp"
android:textSize="12sp" />
</LinearLayout>
<ImageView android:id="@+id/lastpage"
android:src="@drawable/lastpage"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="200"
android:scaleType="center"
android:layout_gravity="right"/>
</LinearLayout>