我正在制作一个位于主屏幕上的 Android AppWidget。
用户的主屏空间很宝贵,所以希望widget小一点。理想的大小是 2x1 单元格。
- Some documentation建议你可以有任何你喜欢的尺寸?
- 但是 AppWidget graphical design guidelines imply仅支持标准尺寸:4x1、3x3、2x2。
- 这是指可用的 PhotoShop 模板还是 Android 本身的限制?
- 我发现 2x1 小部件可以在我的实际设备 (HTC Wildfire) 上运行,但在模拟器上扩展为 2x2。
- HTC 有自己的 special implementation of the home screen ,所以也许我的小部件只能在 HTC 设备上以 2x1 分辨率工作?
有什么方法可以创建 2x1 小部件,还是我应该使用标准尺寸?
我的小部件改编自 Simple Wiktionary样本。
- The manifest有
android:minWidth="146dip"
和android:minHeight="72dip"
。 - 有a RelativeLayout with
android:layout_width="fill_parent"
和android:layout_height="wrap_content"
我刚开始使用 Android,如果这是一个愚蠢的问题,请提前致歉。 :)
最佳答案
I'm just starting with Android, so apologies in advance if this is a silly question. :)
这绝对不是一个愚蠢的问题。
Does that refer to the available PhotoShop templates or is it a limitation of Android itself?
我的印象是 2x1 是合法尺寸,但我没有尝试过那种尺寸。
HTC have their own special implementation of the home screen, so maybe my widget will only work at 2x1 on HTC devices?
不同的主屏幕实现可能会以不同方式解释大小,但我希望它们大体上保持一致。
Is there any way to create a 2x1 widget, or should I use a standard size?
您可以试验较小的 android:minHeight
值,看看是否需要一个新的阈值来说服模拟器给您一个 2x1 的应用小部件。也就是说,使用 2x2 应用小部件可能会获得更一致的结果。
关于android - Android AppWidgets 是否限于特定尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3734944/