Android:visibility Hidden Visible not visible

Source: Internet
Author: User


In Android development, most of the controls have the visibility attribute, with 3 properties of "visible", "invisible", and "Gone" respectively. Used primarily to set the display and hiding of control controls. Some people may wonder what is the difference between invisible and gone??? So, let's look at the following with this question:

It is set in the XML file and Java code as follows:

Viewable (visible)

XML file: android:visibility= "visible"

Java code: view.setvisibility (view.visible);

Not visible (invisible)

XML file: android:visibility= "Invisible"

Java code: view.setvisibility (view.invisible);

Hidden (GONE)

XML file: android:visibility= "Gone"

Java code: view.setvisibility (View.gone);

By the above demonstration

Visible: Setting controls Visible

INVISIBLE: Setting controls not visible

GONE: Setting Controls to hide

The main difference between invisible and gone is that when the control visibility property is invisible, the interface retains the space occupied by the view control, while the control property is gone, the interface does not preserve the space occupied by the view control.

Android:visibility Hidden Visible not visible

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.