Webandroidx.compose.material.icons.filled; androidx.compose.material.icons.outlined; androidx.compose.material.icons.rounded; androidx.compose.material.icons.sharp Web@ Composable fun Test { var offset by remember { mutableStateOf (0f) } TextField (value = "long1 long2 long3 long4 long5 long6 long7 long8 long9 long10 long11 long12 text", onValueChange = {}, singleLine = true, modifier = Modifier . fillMaxWidth () . scrollable ( orientation = Orientation.Horizontal, state = rememberScrollableState { delta ...
在Jetpack Compose中使TextField可滚动 - 问答 - 腾讯云开发者社 …
WebMay 31, 2024 · rememberScrollableState{delta-> mViewModel.scrollState += delta delta } ) If you haven't already, create a new file named mViewModel.kt, extending the viewmodel … Web使用 horizontalScroll 的 TextField 示例. @Composable fun Test() { TextField( value = "long1 long2 long3 long4 long5 long6 long7 long8 long9 long10 long11 long12 text", onValueChange = {}, singleLine = true, modifier = Modifier .fillMaxWidth() .horizontalScroll(rememberScrollState()) ) } 使用 scrollable 的 TextField 示例. go by or elapse
Bar-Chart-Component-for-Jetpack-Compose/BarChart.kt at main
WebJan 10, 2024 · .scrollable(orientation = Orientation.Horizontal, state = rememberScrollableState { delta -> when {delta < 0 -> onSwipeLeft(delta) delta > 0 -> onSwipeRight(delta) else -> {}} delta}) How to add tap gestures. If we want to manage double taps or a long press, we have to use another modifier, in this case, the one called … Web您应该将所有状态保存在视图模型中。. 事件可以保存滚动位置。. rememberScrollableState {delta -> mViewModel.scrollState += delta delta } ) 如果尚未创建,请创建一个名 … WebIn Android, a Scrollable modifier detects the scroll gestures, and calculates the scroll offset value, but does not offset its contents. In simpler words, the Scroll Modifier will calculate the amount of scroll performed in a particular orientation (vertical or horizontal), but will actually not displace the view or the element in either scroll direction. goby nuclei