I have been looking for a post to create vertical scrolling multiple textviews. similar to one shown here http://vertical-scroller.vbarsan.com/
But all post are related to creating horizontal scrolling (Marquee) textview.
I have been looking for a post to create vertical scrolling multiple textviews. similar to one shown here http://vertical-scroller.vbarsan.com/
But all post are related to creating horizontal scrolling (Marquee) textview.
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"/>
I hope this helps
You have 2 choice for that:
1) Use Native way: using thread, put 10 spaces before any text and in each second remove left side space and increase right space and so on, until it's limits. Hope you understood. Predefined TextView's below properties also uses this method.
2) Use predefined control TextView with below properties:
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
Have main layout as ScrollView ,Create vertical LinearLayout as child of ScrollView and create (number of textview you required ) textViews inside LinearLayout.
you should change android:layout_height
as per your code
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#FF4081"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="1st Line !" />
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="2nd line !"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="3rd line !" />
</LinearLayout>
</ScrollView>
use this example code below it will do a marquee like html
<TextView
android:id="@+id/mywidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:textColor="#ff4500"
android:text="Simple application that shows how to use marquee, with a long text" />