Demo:
1) MainActivity.java:
2) activity_main.xml:
3) Download this Project Click Here
1) MainActivity.java:
package
com.venky.autoscrolltextviewdemo;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}2) activity_main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#5F04B4"
android:orientation="vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:text="Welcome to
Horizontal Auto Scroll TextView,It is auto scrolling horizontally..."
android:textColor="#ffffff"
android:textSize="15dp"
android:textStyle="bold"
/>
</LinearLayout>
No comments:
Post a Comment