Android Development Small effect--merry

Source: Internet
Author: User

The effect of implementing the text scrolling effect in layout, which is merry, is simply to add these lines of code to the response control to

Android:singleline= "true"
Android:ellipsize= "Marquee"
android:marqueerepeatlimit= "Marquee_forever"
Android:focusable= "true"
Android:focusableintouchmode= "true"

Android:singleline= "true"

Sets the single-line display. If used with Layout_width, when the text is not all displayed, followed by "..." to indicate, do not set Singleline or set to False, the text will be automatically wrapped

Where Android:ellipsize has so many properties

Android:ellipsize= "Start"-ellipsis appears at the beginning "... pedia"
Android:ellipsize= "End"--ellipsis appears at the end "Encyc ..."
Android:ellipsize= "Middle"--ellipsis displayed in the middle "en...dia"
Android:ellipsize= "Marquee" – displayed in horizontal scrolling mode (when the current focus is needed)

android:marqueerepeatlimit= "Marquee_forever"

Set the number of cycles

Android:focusable= "true"

Focusable=true    
Allow the button to get focus

But the button doesn't get the focus on the touchscreen.
Android:focusableintouchmode= "true"
For a control, the first click does not trigger the OnClick event, only the focus is shifted to the TextView, and then the second click will trigger the onclick

Android Development Small effect--merry

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.