sachi
sachi

Reputation: 479

How to set the Tab Visibility in android?

I am having a tab widget with three tabs, I need to set the visibility for that when the:

tabhost.setcurrentTab(0);

the other two tabs should be invisible.

Upvotes: 1

Views: 4240

Answers (1)

Ovidiu Latcu
Ovidiu Latcu

Reputation: 72311

You need to set the visibility to View.GONE for the tab you want to hide, as follows:

tabHost.getTabWidget().getChildAt(hiddenTabPosition)
                      .setVisibility(View.GONE);

Upvotes: 2

Related Questions