Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You must use LienarLayout inside of ScrollView. RelativeLayout ignores orientation and used when you want put your items with absolute position. Your xml layout has many things to change . Can you send image of your layout to understand what exacly you want.</p> <p>Here you have :</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="fill_parent" android:layout_height="fill_parent"&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Starting place" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center"&gt; &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Date 1" /&gt; &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Time 1" /&gt; &lt;/LinearLayout&gt; &lt;Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Arrival place" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center"&gt; &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Date2" /&gt; &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="50dp" android:text="Time2" /&gt; &lt;/LinearLayout&gt; &lt;Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Submit" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>In last linearlayout 2nd button i have include <strong>layout_marginLeft</strong> but with linearlayout gravity center it will center buttons and divide this space between two button, so you can manipulate with space between them.</p> <p>By default layout will fill parent but in your second image you have something like right margin if you need it you can use android <a href="http://developer.android.com/guide/practices/screens_support.html#qualifiers" rel="nofollow">configuration qualifiers</a> but better way to not duplicate layout xml is using values-land qualifier and add dimens folder where you can add padding value and add to your layout into first layout child of scrollview <strong>android:paddingRight="@dimen/your_property_name"</strong>. More about <a href="http://developer.android.com/guide/topics/resources/more-resources.html#Dimension" rel="nofollow">dimen resources</a>.</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