首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android scale选项卡图

android scale选项卡图
EN

Stack Overflow用户
提问于 2012-07-12 17:13:35
回答 1查看 1.1K关注 0票数 0

我为每个选项卡设置了一个图像,结果与预期一致,但在某些设备(平板电脑或某些智能手机型号)上,图像较大且高于文本。如何解决?谢谢。

活动,

代码语言:javascript
复制
        StateListDrawable selector = new StateListDrawable();

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

        icon.setImageDrawable(selector);

布局,

代码语言:javascript
复制
<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>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-12 17:27:30

我相信这些链接会正确地指导你解决你的问题。

http://developer.android.com/guide/practices/screens_support.html

http://coding.smashingmagazine.com/2011/06/30/designing-for-android/

http://www.coronalabs.com/blog/2011/01/27/dynamic-image-resolution-made-easy/

另外,这个问题提出了一个类似的问题,我相信。

Determining image sizes for multiple android screen sizes/densities

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11448559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档