Scrolling a TextView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Scrolling a TextView

Postby prajkti.khadse » Wed Apr 15, 2009 9:25 am

Hi all

i have TextView and EditText on the Same acivity.
out of those, i want to make the TextView scrollable.

i've tried
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  android:scrollbars="vertical"  
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

and it displays the scrollbar but m not able to scroll it.... :?

can anyone plz help me out....
prajkti.khadse
Developer
Developer
 
Posts: 32
Joined: Thu Mar 19, 2009 1:01 pm
Location: Bangalore

Top

Postby WarrenFaith » Wed Apr 15, 2009 10:57 am

Simply wrap your TextView with ScrollView and you can scroll...
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_height="wrap_content" android:layout_width="fill_parent">
  8.  
  9.      <ScrollView android:layout_marginBottom="50dip" android:id="@+id/ScrollView01" android:layout_height="40dip" android:layout_width="fill_parent">
  10.  
  11.           <TextView android:id="@+id/TextView01" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="This text view should act as header This text view should act as header This text view should act as header This text view should act as header This text view should act as header This text view should act as header This text view should act as header  " />
  12.  
  13.      </ScrollView>
  14.  
  15. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby prajkti.khadse » Wed Apr 15, 2009 12:57 pm

Thanks a lot...

it worked... :)
prajkti.khadse
Developer
Developer
 
Posts: 32
Joined: Thu Mar 19, 2009 1:01 pm
Location: Bangalore

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 6 guests