Android 删除选项卡按钮周围的灰色边框(使用FragmentTabHost)
我正在使用FragmentTabHost获取选项卡,但每个选项卡按钮周围都出现了灰色边框。请引导我摆脱这个灰色的边界。见以下附件: 我希望它看起来像: 我的布局是:Android 删除选项卡按钮周围的灰色边框(使用FragmentTabHost),android,fragment-tab-host,Android,Fragment Tab Host,我正在使用FragmentTabHost获取选项卡,但每个选项卡按钮周围都出现了灰色边框。请引导我摆脱这个灰色的边界。见以下附件: 我希望它看起来像: 我的布局是: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/tabhost" />
<android.support.v4.app.FragmentTabHost
android:id="@+id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
>
<FrameLayout
android:id="@+id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</android.support.v4.app.FragmentTabHost>
</RelativeLayout>
提前谢谢。我自己做了这项工作,它按要求工作。谢谢 仅用于以下代码:
mTabHost.addTab(mTabHost.newTabSpec(HOMETAB_TAG).setIndicator(""), HomeContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(QRTAB_TAG).setIndicator(""), QrContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(AROUNDTAB_TAG).setIndicator(""), AroundContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(SHARETAB_TAG).setIndicator(""), ShareContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(MORETAB_TAG).setIndicator(""), MoreContainerFragment.class, null);
mTabHost.getTabWidget().getChildAt(0).setBackgroundResource(R.drawable.home_selector);
mTabHost.getTabWidget().getChildAt(1).setBackgroundResource(R.drawable.qr_selector);
mTabHost.getTabWidget().getChildAt(2).setBackgroundResource(R.drawable.around_selector);
mTabHost.getTabWidget().getChildAt(3).setBackgroundResource(R.drawable.share_selector);
mTabHost.getTabWidget().getChildAt(4).setBackgroundResource(R.drawable.more_selector);
mTabHost.getTabWidget().setStripEnabled(false);
mTabHost.getTabWidget().setDividerDrawable(null);
mTabHost.addTab(mTabHost.newTabSpec(HOMETAB_TAG).setIndicator(""), HomeContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(QRTAB_TAG).setIndicator(""), QrContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(AROUNDTAB_TAG).setIndicator(""), AroundContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(SHARETAB_TAG).setIndicator(""), ShareContainerFragment.class, null);
mTabHost.addTab(mTabHost.newTabSpec(MORETAB_TAG).setIndicator(""), MoreContainerFragment.class, null);
mTabHost.getTabWidget().getChildAt(0).setBackgroundResource(R.drawable.home_selector);
mTabHost.getTabWidget().getChildAt(1).setBackgroundResource(R.drawable.qr_selector);
mTabHost.getTabWidget().getChildAt(2).setBackgroundResource(R.drawable.around_selector);
mTabHost.getTabWidget().getChildAt(3).setBackgroundResource(R.drawable.share_selector);
mTabHost.getTabWidget().getChildAt(4).setBackgroundResource(R.drawable.more_selector);
mTabHost.getTabWidget().setStripEnabled(false);
mTabHost.getTabWidget().setDividerDrawable(null);