上面那个橙色的图片大小是150*60  应该可以铺满这个tab才对,为什么是这样的效果?被缩小了

解决方案 »

  1.   

    没有 <?xml version="1.0" encoding="utf-8"?> 
    <TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@android:id/tabhost" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"> 
        <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="fill_parent" 
                 /> 
         
        </LinearLayout> 
    </TabHost>
      

  2.   

    代码如下 spec = tabHost.newTabSpec("forecast").setIndicator(res.getString(R.string.str_forecast), 
             res.getDrawable(R.drawable.yugao)) 
                          .setContent(intent); 
            tabHost.addTab(spec); 
      

  3.   

    tabhost控件就是这样的,上面图片,下面文字。 spec = tabHost.newTabSpec("forecast").setIndicator(res.getString(R.string.str_forecast), 
                    res.getDrawable(R.drawable.yugao)) 你可以考虑把图片改成背景的设置。
      

  4.   

    http://blog.csdn.net/ch_984326013/article/details/6602602http://blog.csdn.net/ch_984326013/article/details/6605537
      

  5.   

    因为你使用的是系统控件,而系统控件将中间那个放图片的控件设死了,所以不能填满整个TAB区域