android布局中的tab1xml中包含了另一xml,如下
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dip">
<include layout = "@layout/bottom" />
</LinearLayout>其中被包含的bottom.xml:
<?xml version="1.0" encoding="gb2312"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
  <LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:background="#434343"
>
<TextView  
    android:id="@+id/bottomtextView1"
    android:layout_width="80dip" 
    android:layout_height="40dip" 
    android:text="首页"
    android:layout_gravity="center"
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="14dip"
android:paddingTop="6dip"
    />
</LinearLayout>  
</LinearLayout>现需:点击 界面上的 首页 二字后,首页所在TextView这一块变成黑色,并首页 二字下面有一蓝色下划线,这如何实现呀,thanks

解决方案 »

  1.   

    不要用textview,建议使用checkbox,去掉背景
      

  2.   

             bottom.xml 文件中 TextView下添加 ImageView蓝色下划线图片 默认为不显示  当点击“首页”时 TextView 所在LinearLayout背景变为 黑色 并且蓝色下划线图片显示。
    哈哈 
      

  3.   

    TextView放在一个layout里,点击后layout背景变为黑色,textview下面放一个imageview,开始用setVisibility设为不可见,点击设为可见
      

  4.   

    两转图片 一张无背景色  一张有背景色有下划线  然后写个selector  就可以了布局也是可以实现的稍微麻烦点儿 
      

  5.   

    我怎么感觉跟3.2 默认的TAB风格一样?LZ可以去参考一下3.2的API DEMOS里面的代码。
      

  6.   

    TextView实现某段文字的点击可以用ClickSpan,给某段文字添加背景可以使用BackgroundSpan你可以看看这里Android使用TextView实现无下划线超链接