Note that there are some explanatory texts on larger screens.

plurals
  1. POany way to have a 2 buttons beside each others that fills the width without having multiple xml files?
    text
    copied!<p>I want to know if this is possible to have to buttons beside each others which fills the with in any screen size but without designing multiple xml layouts.<br> Is it possible? I've found this information and I tried that, but not working for my purpose: <a href="https://stackoverflow.com/questions/14150780/android-align-linearlayout-center-for-all-screen-sizes">Android: Align LinearLayout center for all screen sizes</a> </p> <p>This is my layout:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/background" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="vertical" &gt; &lt;Button android:layout_weight="1" android:id="@+id/btnPersonalInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="#FFC40D" android:drawableTop="@drawable/person" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/personal_info" android:textColor="@color/button_text" /&gt; &lt;Button android:layout_weight="1" android:id="@+id/btnLawyerInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="#EE1111" android:drawableTop="@drawable/lawyer" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/lawyer_info" android:textColor="@color/button_text" /&gt; &lt;Button android:id="@+id/btnSharesInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="#2976DE" android:drawableTop="@drawable/shares" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/buy_sell" android:textColor="@color/button_text" /&gt; &lt;Button android:id="@+id/btnFinancialInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:layout_marginLeft="10dp" android:background="#902293" android:drawableTop="@drawable/wallet" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/financial_info" android:textColor="@color/button_text" /&gt; &lt;Button android:id="@+id/btnNews" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="#0D9A0E" android:drawableTop="@drawable/news" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/news" android:textColor="@color/button_text" /&gt; &lt;Button android:id="@+id/btnMessages" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:layout_marginLeft="10dp" android:background="#CA5A35" android:drawableTop="@drawable/messages" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/messages" android:textColor="@color/button_text" /&gt; &lt;Button android:id="@+id/btnSync" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="@color/pink" android:drawableTop="@drawable/sync" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/update" android:textColor="@color/button_text" /&gt; &lt;Button android:id="@+id/btnExit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:layout_marginLeft="10dp" android:background="#AF274D" android:drawableTop="@drawable/quit" android:onClick="clickHandler" android:paddingBottom="10dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="10dp" android:text="@string/exit" android:textColor="@color/button_text" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>in my 2 first buttons I set android:layout_weight="1" but nothing happs.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload