About Me



Objectives :
– How to use TextView in Android?
– How to scroll Text in Android?
– How to implement Marquee Text in Android?
– How to make text scrollable in Android?

Getting Started :
1. Create a New Android Application titled as “AutoscrollTextviewDemo” with blank activity.
2. Update the layout xml with code given below.

How to do it?
Here is the XML code for Auto Scroll TextView, update your layout xml file with code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
 
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AutoScroll TextView" />
 
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform" />
 
</LinearLayout>
Download Source Code
Output :








































This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform.

Click here to download source code : Click Here

 
Top