title: define height and position of fragment layout in android
body: <p>I am using fragments in my Android layout. How to set the height of the fragments layout?</p>
  
  <p><strong>This is activity_main.xml</strong></p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Fragment No.1"
      android:onClick="selectFrag" /&gt;
  
   &lt;Button
       android:id="@+id/button2"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:onClick="selectFrag"
       android:text="Fragment No.2" /&gt; 
  
    &lt;fragment
      android:name="com.android.fragmentstest.FragmentOne"
      android:id="@+id/fragment_place"
   android:layout_width="match_parent"
   android:layout_height="match_parent" /&gt;
  
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>This is fragment.xml</strong></p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="utf-8"?&gt;
          &lt;RelativeLayout
         xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="40dp"
      android:layout_height="20dp"
      android:id="@+id/tutlist_fragment"
      android:layout_weight="45"
      android:background="#7bae16"&gt;
  
  
     &lt;TextView
         android:id="@+id/textView1"
         android:layout_width="match_parent"
         android:layout_height="50dp"
         android:layout_weight="1"
         android:text="This is fragment No.1"
         android:textStyle="bold" /&gt;
  
         &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I need to set the maximum height of the fragment and the position of the fragment. How will I achieve that?</p>