How to hide dynamic frame change in android

I want to dynamically collapse the framelayout in android, how can I achieve this.

+5
source share
3 answers

provide the id attribute to your frameLayout, specifying it in the xml file as:

android:id="@+id/someID"

and in the code write the following:

FrameLayout layout = (FrameLayout)findViewById(R.id.someID);
layout.setVisibility(View.GONE); // you can use INVISIBLE also instead of GONE
+13
source

Change the visibility as follows:

FrameLayout layout = (FrameLayout) findViewById (R.id.your_id);
layout.setVisibility (View.GONE); // or View.INVISIBLE, depending on what you exactly want
+5
source

You can hide or show views using setVisibility (int) .

+1
source

All Articles