Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have modified your layout and put it in a scroll view.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".Matchdetails" &gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" android:layout_marginTop="15dp" android:text="@string/Name" /&gt; &lt;EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@id/textView2" android:layout_alignParentRight="true" android:ems="10" android:inputType="text" &gt; &lt;/EditText&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:text="@string/Maledet" /&gt; &lt;Spinner android:id="@+id/spin_ras" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@id/textView2" android:layout_below="@id/textView2" android:layout_toLeftOf="@id/textView1" /&gt; &lt;Spinner android:id="@+id/spin_nak" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/spin_ras" android:layout_below="@id/spin_ras" android:layout_toLeftOf="@id/textView1" /&gt; &lt;Spinner android:id="@+id/spin_gotra" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/spin_nak" android:layout_toRightOf="@id/textView1" /&gt; &lt;Spinner android:id="@+id/spin_pada" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@id/spin_nak" android:layout_toRightOf="@id/textView1" /&gt; &lt;EditText android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView4" android:layout_alignBottom="@+id/textView4" android:layout_alignRight="@id/spin_pada" android:ems="10" android:inputType="text" /&gt; &lt;TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/spin_nak" android:layout_centerHorizontal="true" android:layout_marginTop="14dp" android:text="@string/Femdet" /&gt; &lt;TextView android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@id/spin_nak" android:layout_below="@id/textView3" android:layout_marginTop="14dp" android:text="@string/Name" /&gt; &lt;Spinner android:id="@+id/spin_fras" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView4" android:layout_below="@id/editText2" android:layout_marginTop="14dp" android:layout_toLeftOf="@id/textView1" /&gt; &lt;Spinner android:id="@+id/spin_fnak" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@id/spin_fras" android:layout_below="@id/spin_fras" android:layout_toLeftOf="@id/textView1" /&gt; &lt;Spinner android:id="@+id/spin_fpada" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@id/spin_fnak" android:layout_toRightOf="@id/textView1" /&gt; &lt;Spinner android:id="@+id/spin_fgotra" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/spin_fpada" android:layout_toRightOf="@id/textView1" /&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/spin_fpada" android:layout_centerHorizontal="true" &gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/spin_fnak" android:layout_margin="5dp" android:text="@string/Submit" /&gt; &lt;Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:layout_toRightOf="@id/button1" android:text="@string/Cancel" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>A couple of things to be noted.</p> <ol> <li><p>You need @+id/view_id only when you create a new View ID for the first time in your layout. When you refer an existing id you can do so with @id/view_id.</p></li> <li><p>Avoid hard coding the values wherever possible. You will find it difficult while using your layout to fit different screens.</p></li> <li><p>The above layout isn't perfect, but will fit your requirement. You may want to use nested views in your layout and get the hang of what the different attributes mean in the layout xml. That, you will gain by trying out different things.</p></li> </ol> <p>In general, Designing for multiple screens involves considering a number of factors. </p> <ol> <li>Supporting screens with different sizes and resolutions (VGA/ HVGA / WVGA/ WXGA) screens/(hdpi/mdpi..) densities.</li> <li>Different Form factors(smartphones/tablets) </li> <li>Different orientations(landscape/portrait) on the same device.</li> </ol> <p>You should perhaps read <a href="http://developer.android.com/training/multiscreen/index.html" rel="nofollow">this</a> for a complete know-how about designing your app for multiple screen types. And there's a sample application in the link.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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