How to change visibility of layout programmatically

后端 未结 5 1204
温柔的废话
温柔的废话 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

    TextView view = (TextView) findViewById(R.id.textView);
    view.setText("Add your text here");
    view.setVisibility(View.VISIBLE);
    

提交回复
热议问题