在轮播中反应本地动画文本

时间:2018-12-09 15:02:44

标签: react-native carousel

如何为RN Carousel中的文本设置动画,例如“ react-native-text-ticker”中的TextTicker或“ react-native-marquee”中的MarqueeText? 我试图在“轮播”中添加一个TextTicker,但它不起作用吗?...

render() {
    return (
    <View>
            <Carousel
                ref={(c) => { this._carousel = c; }}
                renderItem={this._renderCarouselItem.bind(this)}
                sliderWidth={'100'}
                itemWidth={'100'}
            />
    </View>
    );
}

_renderCarouselItem ({item, index}) {
    return (
        <View>
            <TextTicker
               style={{ fontSize: 24 }}
               duration={3000}
               loop
               bounce
               repeatSpacer={50}
               marqueeDelay={1000}
            >
          Super long piece of text is long. The quick brown fox jumps over the lazy dog.
            </TextTicker>
        </View>
    );
}

0 个答案:

没有答案