ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3.07k stars 611 forks source link

tabs onChange多次触发问题 #1142

Closed lexoops closed 3 years ago

lexoops commented 3 years ago

首先给page指定了值,然后用onChange来改变page, 但是出现滑动过快鬼畜现象,求解

lexoops commented 3 years ago

找到解决办法了,我猜测是指定page的缘故,我发现每次改变page的时候onChange事件总是执行2次,于是我去掉page值。 <Tabs ref={(ref)=>{this.TabsRef =ref;}} tabs={tabMeun} onChange={(obj,index)=>{this.selectTab(index)}} renderTabBar={()=>{return <View/>;}}> 外部改变page使用
try {this.TabsRef.scrollTo(index);}catch (e) {}

1uokun commented 3 years ago

这类”如何起巧使用“问题建议发送到https://segmentfault.com/t/antd 和大家一起讨论