1x1的Andr​​oid部件显示为WXGA720屏幕上2x2的小部件 [英] 1x1 Android Widget shows as 2x2 widget on WXGA720 screen

查看:222
本文介绍了1x1的Andr​​oid部件显示为WXGA720屏幕上2x2的小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个1x1的Andr​​oid窗口小部件。我已经设计了图像的每个屏幕像素密度如下:

I'm creating a 1x1 Android widget. I have designed images for each screen density as follows:

ldpi  (120 DPI) = 72 * (120 / 160) == 54 x 54 pixels
mdpi  (160 DPI) = 72 * (160 / 160) == 72 x 72 pixels
hdpi  (240 DPI) = 72 * (240 / 160) == 108 x 108 pixels
xhdpi (320 DPI) = 72 * (320 / 160) == 144 x 144 pixels

我的小窗口规范:

My widget specification:

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" 
    android:minWidth="72dip"
    android:minHeight="72dip"
    android:updatePeriodMillis="1000"
    android:initialLayout="@layout/widget">
</appwidget-provider>

在WVGA800屏幕(HDPI),小部件是1x1的。 上WXGA800屏幕(MDPI),小部件是1x1的。 在WXGA720屏幕(xhdpi),小部件的 2×2

On WVGA800 screens (hdpi), the widget is 1x1. On WXGA800 screens (mdpi), the widget is 1x1. On WXGA720 screens (xhdpi), the widget is 2x2.

有人点我在这里有什么问题的方向?

Can someone point me in the direction of what is wrong here?

推荐答案

的Andr​​oid 4.0之前:(N * 74dip) - 2DIP <一href="http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html">http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html

Before Android 4.0: (n * 74dip) - 2dip http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html

Android 4.0的:70×N - 30 <一href="http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#anatomy">http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#anatomy

Android 4.0: 70 × n − 30 http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#anatomy

还有Android的时候,它会自动添加填充:targetSdkVersion =14以上设置

There's also padding that is automatically added when android:targetSdkVersion="14 or higher" is set.

这篇关于1x1的Andr​​oid部件显示为WXGA720屏幕上2x2的小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆