Reputation: 1691
I have a layout which is mainly a linearlayout with a Button
and another layout which is is a linearlayout again with an EditText
and two buttons : Cancel and Submit.
What I want is initially the first layout to be displayed. When user clicks the button this layout is being replaced by the 2nd layout(the one with the two buttons).
I have already tried ViewFlipper
but the problem is that it takes the height of the one with bigger height. So when first layout is displayed
it has a big white space between the button and the content below it.
Upvotes: 0
Views: 263
Reputation: 11074
If you want to keep using a ViewFlipper
you can fix the height issue by adding this to your ViewFlipper
in XML:
android:measureAllChildren="false"
Upvotes: 1
Reputation: 81
Try use only one layout and set VISIBLE or GONE:
View b = findViewById(R.id.button);
b.setVisibility(View.GONE);
Or If you Have two layouts, use Intent:
Intent i = new Intent(this, ActivityTwo.class);
startActivity(i)
Upvotes: 0