ZealDeveloper
ZealDeveloper

Reputation: 783

Android Show/Hide Tabwidget On button Click

Hey can we hide/show tab layout on button click which will be placed below the tab widget it self.

Eg :

enter image description here

When i try to hide - setVisible(View.GONE) the tabwidget whole screens goes black.

Upvotes: 1

Views: 1267

Answers (1)

J. Maes
J. Maes

Reputation: 6892

The most straightforward way to me would just use the android menu as the way to choose between different tabs instead of a real tab view. When the user clicks on a menu button, you load another activity and the menu gets hidden again.

The tabhost is meant to stay there throughout the entire app lifecycle. Using it like this would be wrong. A way to achieve this using the tab would be to set it completely invisible and then load the activity that normally is in the tab on the whole screen.

Upvotes: 1

Related Questions