0

我有 2 个以上的ActionBar标签。最初我不希望选择任何选项卡。当在 ahandset或 a 上横向时,Tablet它按预期工作,并且当debugging我可以看到选定的选项卡是null. 但是,当在手机上运行代码时portraitActionBar第一个选项卡看起来像是被选中的。调试显示onTabSelectedTabListener和 期间从不调用并且所选选项卡为onCreateonResume

getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); 
getActionBar().addTab(getActionBar().newTab().setTabListener(tabListener).setIcon(R.drawable.tab_icon_1), false);
getActionBar().addTab(getActionBar().newTab().setTabListener(tabListener).setIcon(R.drawable.tab_icon_2), false);
4

1 回答 1

1

Initially I don't want any of the tabs to be selected.

That is not supported, unless you have no tabs. It is also a bizarre UI request -- I can think of zero other environments where a set of tabs has no selection.

于 2013-04-15T14:29:07.320 回答