【发布时间】:2015-10-25 09:04:18
【问题描述】:
我创建了 3 个标签。 但是当我在选项卡之间切换时,选项卡指示器的高度非常小,它就像选项卡上的一条细线。我还没有看到任何可以解决这个问题的帖子。所有这些都是关于如何更改选项卡的颜色指标。
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_ACTION_BAR);
try {
setContentView(R.layout.activity_main);
ActionBar bar = getActionBar();
Log.d("In Tab Activity", bar.toString());
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
Tab tab1 = bar.newTab();
tab1.setText("Contacts");
tab1.setTabListener(this);
bar.addTab(tab1);
Tab tab2 = bar.newTab();
tab2.setText("Messages");
tab2.setCustomView(TabUtils.renderTabView(this, R.string.tab_invitations, R.drawable.ic_add_alert_black_24dp, 5));
tab2.setTabListener(this);
bar.addTab(tab2);
Tab tab3 = bar.newTab();
tab3.setText("History");
tab3.setTabListener(this);
bar.addTab(tab3);
webView = (WebView) findViewById(R.id.webPage);
jSInterface = new AndroidJSInterface(this);
webView.addJavascriptInterface(jSInterface, "AndroidJSInterface");
webView.loadUrl("file:///android_asset/HybridPage2.html", null);
/*
* Fragment main = new MainFragment(); FragmentTransaction ft =
* getFragmentManager().beginTransaction();
* ft.replace(R.id.content_frame, main);
* ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
* ft.addToBackStack(null); ft.commit();
*/
} catch (Exception e) {
Log.d("Exception is", e.getMessage());
}
}
【问题讨论】:
-
你能展示你的代码或者图片什么的吗?
-
显示标签栏实现的代码
-
我已经编辑了我的帖子。
-
您使用的是哪个主题?即你的活动主题或styles.xml中提到的完整应用程序?
-
你找到解决办法了吗?
标签: android