如何支持可调整大小的小部件?

发布于 2024-12-25 18:55:48 字数 282 浏览 2 评论 0原文

我的应用程序支持此 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦断已成空 2025-01-01 18:55:48

好的,我发现的一个解决方案是拥有两组小部件,一组用于旧手机,一组用于新手机。定义两个布尔资源,一种适用于旧手机,另一种适用于新手机,并使用它们来启用/禁用清单中的小部件

是否可以仅显示特定 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文