[align=center]
使用android模拟器为WVGA800时tabHost区只能显示一半的高度,
但是用WQVGA400或者432的时候却是正常的。实在无法理解,
哪位遇到过同样问题的大牛能告诉我下么?[/align]
本来上传个图片的结果貌似上传不了

解决方案 »

  1.   

    WVGA800和WQVGA400的分辨率是不一样的,简单的说一个高分辨的图片在WVGA800显示是正常的,但是在WQVGA400下会放大显示1.5倍,所以你应该改下你的tabHost背景图片
      

  2.   


    如下: <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"> <!-- A paddingTop of zero will remove the strip below the tabs. 
    显示tabhost 里面的内容
    -->
    <FrameLayout android:id="@android:id/tabcontent"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingBottom="45px" >
    </FrameLayout> <RelativeLayout android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/maintabrl"
    > <TabWidget android:id="@android:id/tabs"
    android:tabStripEnabled="false"
    android:layout_alignParentBottom="true"
    android:layout_width="fill_parent"
    android:layout_height="45px" />

    </RelativeLayout>
    </TabHost>
    下面是元素layout:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="@drawable/tab_main_nav_selector"
    android:gravity="center_horizontal" android:orientation="horizontal"
    android:textAppearance="@style/TextViewStyleTabMainNav"
    > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/tabMainNav" android:layout_weight="99"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent" 
    android:gravity="center_horizontal"
    android:orientation="vertical"
    >
    <ImageView android:id="@+id/ivIcon" android:layout_width="30dip"
    android:layout_height="30dip" android:scaleType="fitXY"
    android:layout_marginTop="5dip" android:layout_marginBottom="1dip" />

    <TextView android:id="@+id/tvTitle" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:textSize="14dip"
    android:textAppearance="@style/TextViewStyleTabMainNav"
    android:layout_marginBottom="5dip" />
    </LinearLayout>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
      android:layout_weight="1"
    android:layout_height="fill_parent" 
    android:gravity="right" android:orientation="horizontal"
    >
    <ImageView 
    android:layout_height="fill_parent"
    android:layout_width="wrap_content"
    android:src="@drawable/tab_split"
    />

    </LinearLayout>
    </LinearLayout>