【发布时间】:2021-12-02 19:15:52
【问题描述】:
我在 jetpack compose 中使用 Swipeable 从左到右或从右到左滑动手势。但是我很困惑,如果我可以通过一个可滑动的方法来传递它们?
Box(
modifier = Modifier
.fillMaxWidth()
.swipeable(
state = swipeAbleState,
anchors = mapOf(0f to 0, sizePx to 1),
thresholds = { _, _ ->
FractionalThreshold(0.3f)
},
orientation = Orientation.Horizontal
)
这将为我提供从左到右的滑动,同样,如果我在anchor 中传递mapOf(0f to 0, -sizePx to 1),它将为我提供从右到左的滑动,现在我需要将它们都放在我的Box 中是否可能?
【问题讨论】:
标签: android android-jetpack-compose