1

I am developing the UI for one activity.In that activity I have added one scroll view .In that scroll view I have added one linear layout & in that linear layout I have added one edit text.Now I want to make that edit text as scrollable so how it will be possible?

user2459539
  • 29
  • 1
  • 5
  • You need to have enough controls in layout for the scroll bar to become active. Not sure with one edit text you can get it to scroll. – Wand Maker Jul 05 '13 at 14:34

3 Answers3

3

Try this code..

  // For horizontal scroll  
 android:scrollHorizontally="true"  

  //For vertical scroll
 android:scrollbars = "vertical"
ridoy
  • 6,010
  • 2
  • 26
  • 60
Benil Mathew
  • 1,598
  • 10
  • 22
3

You can't put a scrollview inside of a scrollview

<ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="fill_parent"
        android:layout_height="100dp" >


        <EditText
            android:id="@+id/editText1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK" >

            <requestFocus />
        </EditText>

    </ScrollView>
Guilherme Gregores
  • 1,020
  • 2
  • 10
  • 26
0

From XML you can try with..

<EditText
    android:id ="@+id/editInput"
    android:layout_width ="0dip" 
    android:layout_height ="wrap_content" 
    android:layout_weight ="1" 
    android:inputType="textCapSentences|textMultiLine"
    android:maxLines ="4" 
    android:maxLength ="2000"   />

Else, follow these..

Community
  • 1
  • 1
ridoy
  • 6,010
  • 2
  • 26
  • 60