Visible and invisible with a flag

I have a screen with 5 lines. There are 3 editTexts in each line. After the 5th line there is a flag, and below it is another line with 3 editors. I wish the 6th line to be invisible when I first open my application, and when the user checks the checkbox, a line appears. Is it possible? thanks

final CheckBox checkbox = (CheckBox) findViewById(R.id.box); checkbox.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks, depending on whether it now checked if (((CheckBox) v).isChecked()) { ????????????? } else { ??????????? } } }); 
+4
source share
1 answer

In your layout xml file add

 android:visibility="gone" 

which should be hidden at startup.

Then in your code:

 myHiddenView.setVisibility(View.VISIBLE); 

to make it visible.

+12
source

Source: https://habr.com/ru/post/1340998/


All Articles