代码之家  ›  专栏  ›  技术社区  ›  Kirankumar Dafda

如何使用左箭头和右箭头自定义箭头-反应本机幻灯片放映

  •  0
  • Kirankumar Dafda  · 技术社区  · 8 年前

    我正在使用 this React Native中的插件,我需要使用自定义箭头或文本箭头,就像 < > 但我不能用下面的那种 arrowLeft arrowRight 有左箭头和右箭头的例子吗

    箭头左对象可选-组件箭头左

    右箭头对象可选-组件右箭头

    1 回复  |  直到 8 年前
        1
  •  1
  •   Manjeet Singh    8 年前

    您可以简单地传递任何组件,即

    import Slideshow from 'react-native-slideshow';
    import {Image} from 'react-native'
    
    // ...
    
    render() {
      return (
        <Slideshow 
          dataSource={[
            { url:'http://placeimg.com/640/480/any' },
            { url:'http://placeimg.com/640/480/any' },
            { url:'http://placeimg.com/640/480/any' }
        ]}
        arrowLeft={<Image source={require(PATH_TO_LEFT_ICON)}/>}
        arrowRight={<Image source={require(PATH_TO_RIGHT_ICON)}/>}/>
      );
    }
    

    **我使用图像作为组件,你可以使用任何你想要的。 现在你可以走了。

    推荐文章