title: How to stop a textbox from scrolling in android
body: <p>I am trying to create a View with an image and a list view in linear layout with vertical orientation and a EditText that should be on top all the times. I should be able to scroll the image and listview together, but not the EditText at the bottom.</p>
  
  <p>I am somewhat new to android and sorry if i am not making any sense. ask me anything you need for additional info. </p>
  
  <p>Here is my code..</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="fill_parent"
      android:layout_height="fill_parent"&gt;
  
      &lt;ScrollView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:background="#CDBCDE"&gt;
  
              &lt;FrameLayout
                  android:id="@+id/post_container"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"&gt;
  
                  &lt;ImageView
                      android:id="@+id/post_profilePictureView1"
                      android:layout_width="75dp"
                      android:layout_height="75dp"
                      android:layout_marginLeft="10dp"
                      android:layout_marginTop="10dp"
                      android:maxHeight="75dp"
                      android:maxWidth="75dp"
                      android:padding="5dp"
                      android:src="@drawable/ic_launcher_web"/&gt;
  
                  &lt;LinearLayout
                      android:layout_width="200dp"
                      android:layout_height="wrap_content"
                      android:layout_marginLeft="85dp"
                      android:layout_marginTop="15dp"
                      android:weightSum="1"&gt;
  
                      &lt;TextView
                          android:id="@+id/post_nameView1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:ellipsize="end"
                          android:lines="1"
                          android:maxLength="20"
                          android:maxLines="1"
                          android:singleLine="true"
                          android:text="Name"
                          android:textSize="14dp"
                          android:textStyle="bold" /&gt;
                  &lt;/LinearLayout&gt;
  
              &lt;/FrameLayout&gt;
  
              &lt;ListView
                  android:id="@+id/commentsListView"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:layout_below="@id/post_container"
                  android:layout_marginLeft="6dp"
                  android:layout_marginRight="6dp"
                  android:layout_marginBottom="8dp"
                  android:background="#CCBBAA"/&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
      &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:background="#EDf3F4"
          android:layout_alignParentEnd="true"
          android:layout_alignParentBottom="true"
          android:focusable="true"
          android:focusableInTouchMode="true"&gt;
          &lt;EditText
              android:id="@+id/newCommentTextView"
              android:layout_width="315dp"
              android:layout_height="wrap_content"
              android:layout_marginBottom="5dp"
              android:nextFocusUp="@id/newCommentTextView"
              android:hint="Write your comment..."
              android:textSize="20dp"
              android:layout_marginLeft="5dp"
              android:layout_marginTop="5dp"
              android:fontFamily="sans-serif-light"
              android:background="#FFFFFF"&gt;
              &lt;/EditText&gt;
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="35dp"
              android:layout_toRightOf="@id/newCommentTextView"
              android:id="@+id/newCommentPostButton"
              android:text="comment"
              android:padding="3dp"
              android:layout_alignParentRight="true"/&gt;
          &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and the java code is</p>
  
  <pre><code>package com.example.soquestion;
  
  import java.util.ArrayList;
  
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.app.ActionBar;
  import android.support.v4.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  import android.os.Build;
  
  public class MainActivity extends ActionBarActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          getActionBar().hide();
          ListView listview = (ListView) findViewById(R.id.commentsListView);
          String[] values = {"January","February","March","April","May","June","July","August","September","October",
                  "November","December"};
          ArrayList&lt;String&gt; arrayList = new ArrayList&lt;String&gt;();
           for (int i = 0; i &lt; values.length; ++i) {
               arrayList.add(values[i]);
              }
           final ArrayAdapter adapter = new ArrayAdapter(this,
                      android.R.layout.simple_list_item_1, arrayList);
                  listview.setAdapter(adapter);
  
      }
  }
  </code></pre>