如何从的TabBar Android中除去黑线? [英] How to remove black line from tabbar in Android?

查看:148
本文介绍了如何从的TabBar Android中除去黑线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实施了Android应用程序标签栏,但读音字面临的一个问题,用黑line.Can任何一个可以帮助我解决这个

 < TabHost的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
         机器人:ID =@机器人:ID / tabhost
         风格=@风格/ tabhost>    <的LinearLayout机器人:方向=垂直
                    机器人:layout_width =FILL_PARENT
                    机器人:layout_height =FILL_PARENT
                    >        < TabWidget机器人:ID =@机器人:ID /标签
                      机器人:layout_width =WRAP_CONTENT
                      机器人:layout_height =WRAP_CONTENT>< / TabWidget>        <的FrameLayout
            机器人:ID =@机器人:ID / tabcontent
            风格=@风格/ tabcontent/>    < / LinearLayout中>< / TabHost><样式名称=tabhost>
    <项目名称=机器人:layout_width>&FILL_PARENT LT; /项目>
    <项目名称=机器人:layout_height>&FILL_PARENT LT; /项目>
    <项目名称=机器人:背景>#b1b1b1< /项目>
< /风格><样式名称=tabcontent>
    <项目名称=机器人:layout_width>&FILL_PARENT LT; /项目>
    <项目名称=机器人:layout_height>&FILL_PARENT LT; /项目>
    <项目名称=机器人:背景>#FFFFFF< /项目>
    <项目名称=机器人:paddingTop> 1dip< /项目>
< /风格>


解决方案

这行添加到相关的java类:

  tabHost.getTabWidget()setStripEnabled(假)。

(<一个href=\"http://developer.android.com/reference/android/widget/TabWidget.html#setStripEnabled%28boolean%29\"相对=nofollow>来源)

I implemented tab bar in android application but i m facing a issue with black line.Can any one help me with this

 <TabHost xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@android:id/tabhost"
         style="@style/tabhost">

    <LinearLayout   android:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    >

        <TabWidget    android:id="@android:id/tabs"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"></TabWidget>

        <FrameLayout
            android:id="@android:id/tabcontent"
            style="@style/tabcontent"/>                

    </LinearLayout>

</TabHost>

<style name="tabhost">
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:background">#b1b1b1</item>
</style>

<style name="tabcontent">
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:background">#FFFFFF</item>
    <item name="android:paddingTop">1dip</item>
</style>

解决方案

Add this line to the associated java class:

tabHost.getTabWidget().setStripEnabled(false);

(Source)

这篇关于如何从的TabBar Android中除去黑线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆