You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2026. It is now read-only.
描述 / Description
在onPageSelected回调中更新PagerView的高度或者margin,那么只有第一个显示的pager中的点击事件是正常的,切换到其他pager后,点击事件响应出现异常,响应的还是第一个pager中的组件。
复现步骤 / Steps to reproduce
下面代码必现,pagerview左右滑动,不管滑动到那个页面,永远是第一个页面响应点击事件
render() { return ( <ViewPager style={{ flex: 1, marginBottom: this.state.currentPage === 0 ? dimens.getDimens(162) : 0, }} onPageSelected={e => { const {position} = e.nativeEvent; this.setState({currentPage: position}); }} initialPage={0}> <View style={{flex: 1}}> <TouchableOnce style={{flex: 1}} onPress={() => { console.log('点击第一页'); }}> <RNTextView style={{ color: 'white', fontSize: dimens.getDimens(20), textAlign: 'center', marginTop: dimens.getDimens(200), }}> 第一页 </RNTextView> </TouchableOnce> </View> <View style={{flex: 1}}> <TouchableOnce style={{flex: 1}} onPress={() => { console.log('点击第二页'); }}> <RNTextView style={{ color: 'white', fontSize: dimens.getDimens(20), textAlign: 'center', marginTop: dimens.getDimens(200), }}> 第二页 </RNTextView> </TouchableOnce> </View> </ViewPager> ); }库版本 / Library version
6.2.4-rc.1, 6.2.4-rc.2
React Native OpenHarmony version
0.72.82
构建类型 / Build type
None
设备 / Device
None
设备版本 / Device model
Mate 60 Pro
已悉知 / Acknowledgements
Yes