Advertisements

Aatul Palandurkar

AutoScroll TextView Demo

Posted on: September 25, 2013

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.

<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 :

Output in Potrait mode

Output in Potrait mode

Output in Landscape mode

Output in Landscape mode

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.

Advertisements

4 Responses to "AutoScroll TextView Demo"

Recently, I tried to put 2 auto scroll view on the page but it doesn’t work. Why and how can I fix it ?

Like

It is same at that of earlier. Please check the code again, ping me again if the problem is not solved.

Like

Aatul Palandurkar,
thanks for making this article! really useful for me to build my application!
Thanks so much. I’m so happy with using this new method.
You can search my apps on Google Play Store just by searching for ProjectPlay.
Kenny Tam (ProejctPlay Entertainment Studio, Hong Kong)

Like

Hi Kenny,
Glad to hear from you that this post helped you in your project.

I have seen your app too, good job.

Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 8,760 other followers

Tweets

%d bloggers like this: