简体   繁体   English

如何在 Material3 compose 上进行可滑动操作

[英]how to do a swipeable on Material3 compose

On the Material and Material2 Compose there was a SwipeableState and a swipeable option on the Modifier.在 Material 和 Material2 Compose上,Modifier 上有一个SwipeableState和一个swipeable选项。 But in Material3 this doesn't exist, at all.但在 Material3 中,这根本不存在。 So how do you create a Swipeable in Material3?那么如何在 Material3 中创建 Swipeable 呢? If anyone knows please share.如果有人知道请分享。

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: 这个kotlinlang slack包含一个指向issue 229839039的链接,该链接是关于在 Material3 Compose 库中公开SwipeableState以及关于您应该做什么的讨论:

We are currently evaluating the API surface we want to offer for Swipeable, including a possible Foundation API.我们目前正在评估我们希望为 Swipeable 提供的 API 表面,包括可能的 Foundation API。 As there are quite a few issues with Swipeable, we haven't made it public in M3 yet.由于 Swipeable 存在很多问题,我们还没有在 M3 中公开它。

Comment #2 on the issue linked above gives you the full explanation and recommendations if you need something to give to your leads 😃如果您需要给潜在客户一些东西,上面链接的问题的评论 #2 会为您提供完整的解释和建议😃

For the time being, we recommend forking Swipeable if you need it in M3目前,如果您在 M3 中需要它,我们建议分叉 Swipeable

So you can either also include the Material2 Compose library and use its Swipeable or fork it entirely (ie, copy/paste the code into your project) and use it directly.因此,您也可以包含 Material2 Compose 库并使用其Swipeable或完全分叉(即,将代码复制/粘贴到您的项目中)并直接使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM