Android 的非标准小部件尺寸

发布于 2024-09-04 06:21:21 字数 158 浏览 2 评论 0原文

我有一个 Android 上垂直 1x4 主屏幕小部件的用例。支持的尺寸为 4x1,即水平尺寸。有谁知道是否可以实现垂直版本?

我意识到改变屏幕方向会把小部件挤在一起,我对此很满意。如果 css 中有一个相当于“溢出隐藏”的功能那就更好了。

有没有人遇到过这样做的方法?

I have a use-case for a vertical 1x4 home screen widget on android. The supported size is 4x1 ie horizontal. Does anyone know if the vertical version can be implemented?

I realize changing screen orientation would scrunch the widget together, which I'm fine with. Even better would be if there was an equivalent to "overflow hidden" in css.

Has anyone come across a way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

魔法少女 2024-09-11 06:21:21

这似乎是错误的答案。至少据我所知,在 android-7 及以上平台上,您可以根据需要设置尺寸,直至全屏。当然,这不是推荐的大小,但从技术上讲没有什么限制您实现您正在讨论的小部件。需要注意的一个问题是,虽然您可以为纵向和横向提供不同的布局,但 onUpdate 不会在屏幕旋转时被调用。

this seems like the wrong answer. at least as far as i can tell with android-7 platform and above, you can set the size however you want up to the full screen. of course, that's not the recommended sizes, but there's nothing technically restricting you from implementing the widget you're talking about. an issue to watch out for is that while you can supply different layouts for portrait and landscape, onUpdate won't be called on a screen rotation.

恋竹姑娘 2024-09-11 06:21:21

不,你不能这样做。对不起。

No, you can't do this. Sorry.

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