Im trying to set one textview aligned on the left and two bottons aligned on the right as in the image. I’m using margins but I guess this is not the best solution and it’ll change in different phones, anyway my second button doesn’t appear in the app. This is the xml code I have:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#807E7B">
<TextView
android:id="@+id/txtForum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
android:textSize="25dp"
android:textColor="#255094"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
>
</TextView>
<Button
android:id="@+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="New Thread"
android:layout_marginLeft="80dp"
android:layout_marginBottom="5dp">
</Button>
<Button
android:id="@+id/btnBrowser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Browser"
android:layout_marginLeft="100dp"
android:layout_marginBottom="5dp">
</Button>
</LinearLayout>
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#00000000">
</ListView>
</LinearLayout>
This is what I expected:

Thanks
use this layout
you will end up with