如何支持可调整大小的小部件?
我的应用程序支持此 API 范围,
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14" />
它还有一个可以调整大小的基本应用程序小部件,但由于较旧的 API 不支持 android:resizeMode,因此清单以几个预定义的大小列出了此小部件。
支持新旧手机的最佳策略是什么?例如,让旧手机看到一些预定义的小部件尺寸,让新手机看到单个可调整大小的小部件。
My app supports this API range
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14" />
It also has a single basic app widget that could be resizable but since the older APIs do not support android:resizeMode the manifest lists this widget in few predefined sizes.
What is the best strategy for supporting both old and new phones? For example, having old phones seeing a few predefined widget sizes and having new phones seeing a single resizable widget.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我发现的一个解决方案是拥有两组小部件,一组用于旧手机,一组用于新手机。定义两个布尔资源,一种适用于旧手机,另一种适用于新手机,并使用它们来启用/禁用清单中的小部件
是否可以仅显示特定 Android 版本的小部件?
Ok, one solution I found is to have two sets of widgets, one for old phones and one for new phones. Define two boolean resources, one that will be true for old phones and one that will be true new phones and use them to enable/disable the widgets in the manifest
is it possible to show widget only for a certain android version?