sách gpt4 ai đã đi

android - 如何获取我所在的页面的编号? ViewPager 响应 native

In lại 作者:行者123 更新时间:2023-12-05 00:11:02 26 4
mua khóa gpt4 Nike

我正在使用 react-native-community 的 ViewPager 向下滚动我的页面,但是在捕获用户所在的页面时我遇到了麻烦,在 API 中有一个 showPageIndicator: boolean 但仅适用于 IOS,我想我们可以通过这个 bool 在 IOS 中捕获数字,我可以通过某种方式捕获数字。

https://github.com/react-native-community/react-native-viewpager

<>
initialPage={0}
orientation="horizontal"
scrollEnabled
onPageSelected={changePage}
>

1 Câu trả lời

您可以使用 OnPageSelected 属性来获取位置。

<>
initialPage={0}
orientation="horizontal"
scrollEnabled
onPageSelected={e => {console.log("Current page index", e.nativeEvent.position)}}>

关于android - 如何获取我所在的页面的编号? ViewPager 响应 native ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62177590/

26 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com