Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在jetpack compose中单击按钮水平滚动视图寻呼机。有人对此有任何想法吗?我在这里使用伴奏库。
您需要像这样使用寻呼机状态:
val state = rememberPagerState() val scope = rememberCoroutineScope() Button(onClick = { scope.launch { state.scrollToPage(state.currentPage + 1) // or state.scrollBy(100f) } }) { } VerticalPager( pagesCount, state = state ) { page -> }