How to change visibility of layout programmatically

后端 未结 5 1220
温柔的废话
温柔的废话 2020-12-03 06:13

There is the way to change visibility of View, but how can I change programmatically visibility of layout defined in XML? How to get layout object?



        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 06:52

    this is a programatical approach:

     view.setVisibility(View.GONE); //For GONE
     view.setVisibility(View.INVISIBLE); //For INVISIBLE
     view.setVisibility(View.VISIBLE); //For VISIBLE
    

提交回复
热议问题