App/Pages/HomeSwiper.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    TouchableOpacity,
    Image,
    ListView,
    PixelRatio
} from 'react-native';
import Common from '../Commom/constants';
import Swiper from 'react-native-swiper';
// const propTypes = {
//   bannerDate: PropTypes.array.isRequired
// };
export default class HomeSwiper extends Component {
    constructor(props) {
        super(props);
        // console.log(props)
    }
    render() {
        return (
            <Swiper
                height={150}
                loop={true}
                autoplay={true}
                dot={<View style={styles.customDot} />}
                activeDot={<View style={styles.customActiveDot} />}
                paginationStyle={{
                    bottom: 10
                }}
                >
                {this.props.bannerDate.moduleDetail.map((banner) => {
                    return (
                        <TouchableOpacity key={banner.title} activeOpacity={0.75}
                            onPress={() => { alert('我是banner') } }
                            >
                            <Image
                                style={styles.bannerImage}
                                source={{ uri: banner.image }}
                                />
                        </TouchableOpacity>
                    )
                }) }
            </Swiper>);
    }
}

const styles = StyleSheet.create({
    customDot: {
        backgroundColor: '#ccc',
        height: 1.5,
        width: 15,
        marginLeft: 2,
        marginRight: 2,
        marginTop: 2,
    },
    customActiveDot: {
        backgroundColor: 'white',
后面还有 13 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。