marquee for TextView not working
I added marquee tag but it not working.... here is my coding..any one check and tell..why it is not working...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill开发者_StackOverflow_parent"
>
<TextView
android:id="@+id/txt3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:textColor="#00FF00"
android:text="News Blog"
/>
<TextView
android:id="@+id/txt1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Artical topic"
/>
<EditText android:id="@+id/txtName1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/txt2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Artical"
/>
<EditText android:id="@+id/txtName2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="dip"
android:text="Submit" />
<Button
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/submit"
android:layout_alignTop="@id/submit"
android:text="Cancel" />
</LinearLayout>
A marquee starts when a TextView becomes either focused or selected.
You can force it to start by calling
tv.setSelected(true);
if you get any problem then put comment.
精彩评论