Android Racing Lights

Source: Internet
Author: User

Marquee Effect

Layout code

<!--android:ellipsize Set the text too long, how is the control displayed?

start-ellipses appear at the beginning end-ellipses appear at the end middle-ellipses appear in the middle

The marquee-is displayed in the form of a marquee--

<!--running countless times--

android:marqueerepeatlimit= "Marquee_forever"

< get focus when!--touch--

Android:focuseabletouchmode= "true"

<!--make the text line display--

Android:singleline= "true"

<!--call the method in Mytextview with the package name--

<!--android:layout_below= "@+id/textview" puts the bottom of the component under the component of the given ID (PS: Place the current component below the given ID component)-

<!--android:layout_above= "@+id/textview" puts the bottom of the component above the component of the given ID (PS: Place the current component above the given ID component)-

<

Cn.androidstudy.pmd.MyTextView

Android:id= "@+id/textview"

Android:layout_width= "Wrap_content"

android:layout_height= "Wrap_content"

Android:singleline= "true"

Android:ellipsize= "Marquee"

Android:focusableintouchmode= "true"

Android:focusable= "true"

android:text= "@string/hello_world"/>

<cn.androidstudy.pmd.mytextview

Android:id= "@+id/textview1"

Android:layout_width= "Wrap_content"

android:layout_height= "Wrap_content"

Android:singleline= "true"

Android:ellipsize= "Marquee"

Android:focusableintouchmode= "true"

Android:focusable= "true"

android:layout_below= "@+id/textview"

android:text= "@string/hello_world"/>

<cn.androidstudy.pmd.mytextview

Android:id= "@+id/textview2"

Android:layout_width= "Wrap_content"

android:layout_height= "Wrap_content"

Android:singleline= "true"

Android:ellipsize= "Marquee"

Android:focusableintouchmode= "true"

Android:focusable= "true"

android:layout_below= "@+id/textview1"

android:text= "@string/hello_world"/>

Multiple marquee class files

Package CN.ANDROIDSTUDY.PMD;

Import Android.content.Context;

Import Android.util.AttributeSet;

Import Android.widget.TextView;

public class Mytextview extends textview{

Public Mytextview (Context context) {

Super (context); TODO auto-generated Constructor stub}

Public Mytextview (context context, AttributeSet attrs, int defstyle) {

Super (context, attrs, Defstyle); TODO auto-generated Constructor stub}

Public Mytextview (context context, AttributeSet Attrs) {

Super (context, attrs); TODO auto-generated Constructor stub}

public Boolean isFocused () {

return true; }   }

Android Racing Lights

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.