Sanjay Herle
Sanjay Herle

Reputation: 323

Layout replacement in android Layout

I have my layouts like below:

Layout 1 : I have a LinearLayout(parent - horizontal).

Layout 2 & 3: I have two more layouts(2 and 3) side by side in Layout 1.

In Layout 2 (left side), I have a couple of buttons(button 1 and button 2). What I am looking for?

Whenever I click on button1 or button2 - I want to switch the right side layout which is 3 (complete layout - not like changing TextView and all) ( as in the TableLayout`) between some layout 4 and layout 5.

Upvotes: 0

Views: 141

Answers (1)

Reinier
Reinier

Reputation: 3876

Make layout 4 & 5 children of layout3 and take a look at ViewFlipper to switch between the views. Or, take a look at ViewPager if you want to swipe between views.

You can have support for ViewPager (and other >=3.0 features, including fragments) on pre 3.0-devices using the Android Compatibility library.

If you want fuller ActionBar support on earlier devices, you can use ActionBarSherlock (which extends the compatibility package).

Upvotes: 1

Related Questions