Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The dp or dip metric is the number of pixels at density 160 or mdpi, so you set the size on your layout folder as the pixels in mdpi and scale the other sizes as the table below:</p> <ul> <li>xhdpi: 2.0 </li> <li>hdpi: 1.5</li> <li>mdpi: 1.0 (baseline)</li> <li>ldpi: 0.75</li> </ul> <p>For more info see <a href="http://developer.android.com/training/multiscreen/screendensities.html" rel="nofollow">this</a> and <a href="http://developer.android.com/design/style/devices-displays.html" rel="nofollow">this</a></p> <p>Edit: I believe the best way to do this layout is to have all the buttons in a linear layout and have a relative layout as root and do the aligning of the linear layout by the gravity or something like that.</p> <p>My example:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="42dp" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;Button android:id="@+id/btcharts" android:layout_width="130dp" android:layout_height="130dp" android:drawablePadding="-35dp" android:drawableTop="@drawable/chart" android:text="Charts" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;Button android:id="@+id/btimport" android:layout_width="130dp" android:layout_height="130dp" android:drawableTop="@drawable/add" android:text="New Measurement" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" &gt; &lt;Button android:id="@+id/btemail" android:layout_width="130dp" android:layout_height="130dp" android:drawableTop="@drawable/mail" android:text="E-mail" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;Button android:id="@+id/bthistory" android:layout_width="130dp" android:layout_height="130dp" android:drawableTop="@drawable/list" android:text="History" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>I don't know that it's all aligned because I don't have your drawables here, but I can think you can improve from this, also your "charts" button is different because it has a transparent background.</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