我已尝试使用多个链接删除FragmentTabHost
中的所选标签,但对我不起作用
First link
Second link
我也在我的Xml中尝试了这个,但它无法正常工作
android:tabStripEnabled="false"
这是我对fragmenttabhost的布局。
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"
/>
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:background="@drawable/top_bg"
app:tabIndicatorColor="#000"
android:tabStripEnabled="false"
app:tabIndicatorHeight="0dp"
android:layout_height="60dp"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0" />
<LinearLayout
android:id="@+id/tab_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:showDividers="none"
android:orientation="horizontal"
android:weightSum="5" >
<ImageView
android:id="@+id/genralTabBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:padding="15dp"
android:background="@drawable/button_1_off" />
<ImageView
android:id="@+id/treandingTabBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:padding="12dp"
android:background="@drawable/button_2_off" />
<ImageView
android:id="@+id/profileTabBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:padding="12dp"
android:background="@drawable/button_3_off" />
</android.support.v4.app.FragmentTabHost>
在我的设备中,所选标签看起来像(Plz检查图像)
Moto E设备
答案 0 :(得分:3)
对不起,迟到的回复 我也遇到了这个问题,我尝试了很多东西,最后我获得了成功。
尝试以下代码。
gulp.src
fragmentTabHost.getTabWidget()。getChildAt(&#34;你的标签位置&#34;)。setBackground(null);
只需要让孩子接触并将其背景设为null并完成