小编김인권*_*김인권的帖子

如何在react-native-app-intro-slider中使用goToSlide方法?

我使用库react-native-app-intro-slider

\n\n

我制作了自定义 renderPagination,但无法在库中使用 goToSlide 方法。

\n\n

我已经尝试过自定义分页登录注册按钮,但我也无法使用。

\n\n

这是我的代码:

\n\n
const _renderPagination = (activeIndex) => {\nreturn (\n  <View style={style.paginationContainer}>\n    <SafeAreaView>\n      <View style={style.paginationDots}>\n        {slides.length > 1 &&\n          slides.map((_, i) => (\n            <TouchableOpacity\n              key={i}\n              style={[\n                style.dot,\n                i === activeIndex\n                  ? {backgroundColor: '#9948fc'}\n                  : {backgroundColor: 'rgba(0, 0, 0, .2)'},\n              ]}\n            onPress={() => goToSlide(activeIndex, true)} //Error\n            />\n          ))}\n      </View>\n      {activeIndex === slides.length - 1 ? (\n        <View>\n          <TouchableOpacity\n            style={[style.button, {backgroundColor: '#9948fc'}]}\n            onPress={() => navigation.navigate('signup')}\n            >\n            <Text style={style.buttonText}>\xed\x9a\x8c\xec\x9b\x90\xea\xb0\x80\xec\x9e\x85</Text>\n          </TouchableOpacity>\n          <TouchableOpacity\n            style={[style.button, {backgroundColor: 'transparent'}]}\n            onPress={()=> …
Run Code Online (Sandbox Code Playgroud)

react-native

3
推荐指数
1
解决办法
2363
查看次数

标签 统计

react-native ×1