2010-12-23 80 views
0

我想创建一个简单的TabActivity,并遵循开发人员网站上的教程。实施工作正常,但布局困扰我。首先,文本是白色的,背景是白色和灰色时,背景是灰色时。我认为常规行为会是相反的。但是这个底部的这条白线也应该连接不同的标签。为什么我的TabWidget看起来不像它应该的样子?

这里是我的布局:

常规选项卡布局

<TabHost 
     android:id="@android:id/tabhost" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1"> 

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

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

      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" /> 

     </LinearLayout> 

    </TabHost> 

    <include layout="@layout/menu_back_only" /> 

</LinearLayout> 

Selectos

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 

    <item 
     android:drawable="@drawable/menu_home" 
     android:state_selected="true" /> 

    <item 
     android:drawable="@drawable/menu_logout" /> 

</selector> 

这就是,它的外观现在:

Wrong Tab Layout

回答

0

好吧,看起来好像移动设备(HTC Legend)产生错误。发现此线程:Click并设置目标SDK版本真的有窍门。笨!

相关问题