主屏幕小部件尺寸的大屏幕还是华电国际? [英] Home screen widget size for large screen or hdpi?

查看:268
本文介绍了主屏幕小部件尺寸的大屏幕还是华电国际?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是Android的窗口小部件屏幕准则, http://developer.android.com/导/做法/ ui_guidelines / widget_design.html ,我们知道,主屏幕有4 * 4的细胞,并在纵向,每个单元为80个像素宽100像素高。

From Android widget screen guidelines, http://developer.android.com/guide/practices/ui_guidelines/widget_design.html, we know that, home screen has 4*4 cells, and in portrait orientation, each cell is 80 pixels wide by 100 pixels tall.

我觉得这些都是基准HVGA屏幕。怎么样在大屏幕和华电国际的屏幕,他们是否仍然有4 * 4细胞部件和纵向每个单元仍然是80个像素* 100像素?

I think these are for baseline HVGA screen. How about for large screens and hdpi screens, do they still have 4*4 cells for widget and each cell in portrait orientation is still 80 pixels * 100 pixels?

感谢。

推荐答案

你是指独立于设备的像素的像素。正如你可以看到在文档这里

The pixels you are referring to are device independent pixels. As you can see in the documentation here:

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:minWidth="294dp"
    android:minHeight="72dp"
    android:updatePeriodMillis="86400000"
    android:initialLayout="@layout/example_appwidget"
    android:configure="com.example.android.ExampleAppWidgetConfigure" >
</appwidget-provider>

请注意他们是如何使用DP单位,而不是像素。这使得部件能够正确扩展到不同的屏幕分辨率。

Note how they are using dp units, not px. This allows the widget to scale correctly to different screen resolutions.

至于屏幕是4×4的细胞,这是默认的Andr​​oid主屏幕管理器的属性。不管屏幕分辨率的主屏将是4×4电池使用默认的Andr​​oid主屏幕上的时候。

As for the screen being 4x4 cells, this is a property of the default Android homescreen manager. Regardless of screen resolution the home screen will be 4x4 cells when using the default Android home screen.

有其他的主屏幕经理,在那里,比4×4电池有更多的,如​​爱可视平板电脑自定义主屏幕经理。如果你希望你的appwidget在一些不喜欢增加屏幕上细胞的数量或允许输入文本和滚动的应用程序部件特别的事情,这些其他的主屏幕经理的工作,那么你很可能将不得不编写一个自定义版本您的小部件的主屏幕经理。

There are other home screen managers out there that have more than 4x4 cells, such as the custom home screen manager on the Archos tablets. If you want your appwidget to work in some of these other homescreen managers that do special things like increase the number of cells on the screen or allow text input and scrolling in app widgets, then you are probably going to have to write a custom version of your widget for those home screen managers.

所以回答你的问题,假设你总是瞄准的默认主屏幕经理,就是屏幕始终是4×4电池只要你坚持与设备无关的像素,你有什么额外的,你需要做的,让你的appwidget规模和正确的更高的分辨率运行。

So the answer to your question, assuming you are always targeting the default home screen manager, is that the screen is always 4x4 cells and as long as you stick with device independent pixels you have nothing extra you need to do to make your appwidget scale and work correctly on higher resolutions.

这篇关于主屏幕小部件尺寸的大屏幕还是华电国际?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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