繁体   English   中英

android比例标签图像

[英]android scale tab image

我为每个选项卡设置了一个图像,结果与预期的一样,但是在某些设备(平板电脑或某些智能手机型号)上,图像显示为较大且在文本上方。 怎么解决呢? 谢谢。

活动,

        StateListDrawable selector = new StateListDrawable();

        selector.addState(new int[] { android.R.attr.state_selected }, dSel);

        icon.setImageDrawable(selector);

布局,

<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">

      <RelativeLayout       
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">


        <LinearLayout  
            android:orientation="vertical"
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            android:layout_below="@+id/mainLayout">

            <FrameLayout 
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent" 
                android:layout_height="0dip"
                android:layout_weight="1" 
                android:scrollbars="none"
                android:isScrollContainer="false">
            </FrameLayout>

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

        </LinearLayout>         

    </RelativeLayout>

在此处输入图片说明在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM