如何在材料上做一个可滑动的构成3

发布于 2025-02-13 05:26:33 字数 137 浏览 2 评论 0 原文

在材料和材料2 构成上,有一个 swipeablestate swipable 在修饰符上的选项。但是在材料3中,这根本不存在。那么,如何在材料中创建可滑动的3呢?如果有人知道,请分享。

On the Material and Material2 Compose there was a SwipeableState and a swipeable option on the Modifier. But in Material3 this doesn't exist, at all. So how do you create a Swipeable in Material3? If anyone knows please share.

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

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

发布评论

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

评论(2

情未る 2025-02-20 05:26:34

this kotlinlang slack 包括问题229839039 ,它是关于在 swipeablestate 讨论您应该做什么:

我们目前正在评估我们要为可滑动的API表面,包括可能的基础API。由于可滑动有很多问题,因此我们尚未在M3中公开。

关于上面链接的问题的评论#2如果您需要一些东西来给出潜在客户

This kotlinlang slack includes a link to issue 229839039, which is about making SwipeableState public in the Material3 Compose library and a discussion about what you should be doing:

We are currently evaluating the API surface we want to offer for Swipeable, including a possible Foundation API. As there are quite a few issues with Swipeable, we haven't made it public in M3 yet.

Comment #2 on the issue linked above gives you the full explanation and recommendations if you need something to give to your leads ????

For the time being, we recommend forking Swipeable if you need it in M3!

So you can either also include the Material2 Compose library and use its Swipeable or fork it entirely (i.e., copy/paste the code into your project) and use it directly.

誰ツ都不明白 2025-02-20 05:26:34

Swipable的继任者可锚定用锚定draggablestate modifier.andifier.anchoreddraggable 。它们是在组成的1.6.0-alpha01中引入的,并且仍在实验中。这是迁移指南(不幸的是错过了一个完整的示例): https://developer.android.com/jetpack/compose/compose/touch-input/pointer-input/migrate-swipable

The successor of Swipeable is AnchoredDraggable with AnchoredDraggableState and Modifier.anchoredDraggable. They were introduced in Compose-Foundation 1.6.0-alpha01 and are still experimental. Here is the migration guide (that unfortunately misses a complete example): https://developer.android.com/jetpack/compose/touch-input/pointer-input/migrate-swipeable

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