How do I make a button invisible just after click?

前端 未结 5 1843
无人及你
无人及你 2021-01-14 12:01

I would like to know how to make a button visible but when clicked I want it to be invisible so it won\'t be shown at all.

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-14 12:08

    put this line in your Button's on click method.

    Button.setVisibility(View.INVISIBLE);
    

    EDIT: if you make totally gone the Button view and then try

    Button.setVisibility(View.GONE);
    

提交回复
热议问题