如何在材料上做一个可滑动的构成3
在材料和材料2 构成上,有一个 swipeablestate 和 swipable 在修饰符上的选项。但是在材料3中,这根本不存在。那么,如何在材料中创建可滑动的3呢?如果有人知道,请分享。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
在材料和材料2 构成上,有一个 swipeablestate 和 swipable 在修饰符上的选项。但是在材料3中,这根本不存在。那么,如何在材料中创建可滑动的3呢?如果有人知道,请分享。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
this
kotlinlang
slack 包括问题229839039 ,它是关于在swipeablestate
讨论您应该做什么:This
kotlinlang
slack includes a link to issue 229839039, which is about makingSwipeableState
public in the Material3 Compose library and a discussion about what you should be doing: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.Swipable的继任者可锚定用
锚定draggablestate
和modifier.andifier.anchoreddraggable
。它们是在组成的1.6.0-alpha01中引入的,并且仍在实验中。这是迁移指南(不幸的是错过了一个完整的示例): https://developer.android.com/jetpack/compose/compose/touch-input/pointer-input/migrate-swipableThe successor of Swipeable is AnchoredDraggable with
AnchoredDraggableState
andModifier.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