Tabhost底部边框线的android [英] Tabhost bottom border line android

查看:163
本文介绍了Tabhost底部边框线的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截图

请注意,该选项卡下运行(不包括所选的选项卡)的一点微小的灰线?如何更改/改变呢?

Notice that little tiny gray line that runs underneath the tabs (Except selected tab)? How do I change/alter that?

请问这是的FrameLayout,tabHost或TabWidget的一部分?我无法找到一个方法来修改或删除这个小灰线。

Would that be part of the FrameLayout, tabHost or TabWidget? I just cannot find a way to alter or remove this little gray line.

感谢

推荐答案

创建tabindicator.xml如下。

Create tabindicator.xml as following.

然后将下面的code到您的TabActivity类。 ......

Then insert following code in to your TabActivity class. ...

View indicator1 = getLayoutInflater().inflate(R.layout.tabindicator,
    null);
  im1 = (ImageView) indicator1.findViewById(R.id.icon);
  im1.setBackgroundDrawable(getResources().getDrawable(
    R.drawable.home));

  View indicator2 = getLayoutInflater().inflate(R.layout.tabindicator,
    null);
  im2 = (ImageView) indicator2.findViewById(R.id.icon);
  im2.setBackgroundDrawable(getResources().getDrawable(
    R.drawable.account));

mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator(
    indicator1).setContent(new Intent(this, Home.class)));

  mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator(
    indicator2)
    .setContent(new Intent(this, Accounts.class)))

在这里,你可以根据你的要求改变tabindicator.xml。

In here you can change tabindicator.xml according to your requirement.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
  <ImageView android:id="@+id/icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"/>
</RelativeLayout>

这篇关于Tabhost底部边框线的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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