Marquee is not working in textview.I placed the textview inside the TableLoyout between two buttons. And i make the textview as stretchable column. Here is my xml code. I cant figure out the mistake.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="#e0bf64" android:orientation="vertical">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="2"
android:background="#f2cd6d">
<TableRow>
<Button
android:id="@+id/btn_prv"
android:text="@string/prv"
android:textSize="16sp"
android:layout_column="1"
android:layout_width="100dip"
android:background="@drawable/prev_btn_re"
android:paddingLeft="0sp"
android:paddingTop="0sp"
/>
<TextView
android:id="@+id/head_title"
android:layout_width="125dip"
android:gravity="center"
android:paddingLeft="5sp"
android:paddingTop="10dip"
android:paddingRight="0sp"
android:background="#f2cd6d"
android:textSize="16sp"
android:textColor="@color/black"
android:marqueeRepeatLimit="marquee_forever"
android:lines="1"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:scrollHorizontally="true"
android:text="marquee text"
/>
<Button
android:id="@+id/btn_next"
android:text="@string/next"
android:textSize="16sp"
android:gravity="right"
android:layout_width="100dip"
android:background="@drawable/next_btn_re"
android:paddingRight="10sp"
android:paddingTop="5sp"
/>
</TableRow>
</TableLayout>
</LinearLayout>
Please any one tell me why its not working?
A marquee starts when a TextView becomes either focused or selected. You can force it to start by calling setSelected(true) on the TextView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With