Display none start middle on a singleline line in Android

Source: Internet
Author: User

The first button has nothing to write. Ellipsis (...)

Android: ellipsize = "NONE" none, there is no ellipsis.

Android: ellipsize = "start" is omitted to the starting position

Android: ellipsize = "Middle" ellipsis placed in the center

Android: ellipsize = "end": location at the end of the house

Android: ellipsize = "marquee"

 

<? 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: Orientation = "vertical"> <button Android: id = "@ + ID/btn1" Android: layout_width = "100px" Android: layout_height = "wrap_content" Android: text = "0 123456789" Android: singleline = "true" Android: Background = "# f0f"/> <button Android: layout_width = "100px" Android: layout_height = "wrap_content" Android: TEXT = "01 Nicholas Tse 123456789" Android: singleline = "true" Android: ellipsize = "NONE"/> <button Android: layout_width = "100px" Android: layout_height = "wrap_content" Android: text = "02 Chen. guanxi 123456789 "Android: singleline =" true "Android: ellipsize =" start "/> <button Android: layout_width =" 100px "Android: layout_height =" wrap_content "Android: TEXT = "03 Wang Li Hong 123456789" Android: singleline = "true" Android: ellipsize = "Middle"/> <button Android: layout_width = "100px" Android: layout_height = "wrap_content" Android: text = "04 Ren xianqi 123456789" Android: singleline = "true" Android: ellipsize = "end"/> <button Android: id = "@ + ID/BTN" Android: layout_width = "100px" Android: layout_height = "wrap_content" Android: text = "05 Gu tianle 123456789" Android: singleline = "true" Android: ellipsize = "marquee"/> </linearlayout>

  

Invisible inconspicuous usage

Testactivity. Java

Public class testactivity extends activity {button btn1; button BTN; @ override public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); btn1 = (button) This. findviewbyid (R. id. btn1); BTN = (button) This. findviewbyid (R. id. BTN); BTN. setonclicklistener (New onclicklistener () {public void onclick (view v) {btn1.setvisibility (view. invisible); // gone will directly Delete the first button space }});}}

  

 

Click 05. The first button disappears, but which space is occupied,

When gone is used, the first button space is deleted.

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.