Android footstep---Set layout hidden properties

Source: Internet
Author: User

Set the properties of layout to apply to Android view Setvisibility

There are three values visibility VISIBLE, INVISIBLE, GONE.
Visible invisible invisible, without occupying layout space

Java code
    1. Set display
    2. Tv_main_title.setvisibility (view.visible);
    3. Settings do not display or occupy space
    4. Tv_main_title.setvisibility (View.gone);
    5. Setting does not display but takes up space
    6. Tv_main_title.setvisibility (view.invisible);
Set display tv_main_title.setvisibility (view.visible);//settings do not display or occupy space tv_main_title.setvisibility (view.gone);// Settings do not display but Occupy space tv_main_title.setvisibility (view.invisible);

It is best to implement this interface View.onclicklistener,onclick event

For the use of the display part of layout can use this method, set the layout of the part of the ID, and then set up the corresponding view, and then use setvisibility, set parameters, to achieve the purpose.

Private View TESTBT;

TESTBT = Mtestview.findviewbyid (R.ID.TESTBT);

Testbt.setvisibility (view.invisible);

, there is another way to divide layout into parts, set the ID separately, and display the relevant part according to the ID.

Android footstep---Set layout hidden properties

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.