Advertisements

Aatul Palandurkar

Posts Tagged ‘AutoScroll TextView in Android

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

Advertisements

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

Join 13,538 other followers

Tweets

YouTube

Archives

Advertisements
%d bloggers like this: