小部件图标大小为mdpi hdpi xhdpi 2x2 4x4

时间:2013-12-24 04:19:31

标签: android android-widget widget

您好我必须在窗口小部件列表中添加显示窗口小部件描述的图标 有几个问题

a) What is the size of the icon for 2x2 widget and 4x4 widget
b) Do i have to create different icon for mdpi/hdpi/xhdpi 
c) what is the difference between android:icon in reciever and android:previewImage (in xml)

由于

1 个答案:

答案 0 :(得分:1)

不要考虑小部件大小

总是你需要使用mdpi,hdpi和xhdpi drawables

所以你的dpi大小看起来像

 MDPI 32 x 32 px
 HDPI 48 x 48 px
 XHDPI 64 x 64 px

此网格可能因设备而异;例如,许多手机提供4x4网格,平板电脑可以提供更大的8x7网格。添加窗口小部件后,它将被拉伸以占据最小数量的单元格,水平和垂直,满足其minWidth和minHeight约束。

App Widget Design Guidelines