【原创】东方耀reactnative 视频26之-react-native-swiper
来源:互联网 发布:城口综合数据库中标 编辑:程序博客网 时间:2024/06/10 05:33
github上搜索 react-native-swiper
在项目的根目录(即package.json文件所在的目录)
npm的命令:
安装模块:npm i react-native-swiper –save
查看模块:npm view react-native-swiper
删除模块:npm rm react-native-swiper –save
查看帮助命令:npm help 命令
homeUI.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, { Component } from ‘react’;
import {
AppRegistry,
StyleSheet,
Text,Image,View} from 'react-native';
import Swiper from ‘react-native-swiper’;
//var REQUEST_URL=”https://raw.githubusercontent.com/facebook/react-native/master/docs/MoviesExample.json”;
export default class HomeUI extends Component{
constructor(props){
super(props);//这一句不能省略,照抄就行
}
render(){ return ( <Swiper style={styles.wrapper} showsButtons={true} index = {1} autoplay={true}> <View style={styles.slide1}> <Image style={{width:200,height:300}} resizeMode='stretch' source={{uri:'https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png'}} /> </View> <View style={styles.slide2}> <Text style={styles.text}>Beautiful</Text> </View> <View style={styles.slide3}> <Text style={styles.text}>And simple</Text> </View> </Swiper> );}
}
const styles = StyleSheet.create({
wrapper: {
},
slide1: {
flex: 1,
justifyContent: ‘center’,
alignItems: ‘center’,
backgroundColor: ‘#9DD6EB’,
},
slide2: {
flex: 1,
justifyContent: ‘center’,
alignItems: ‘center’,
backgroundColor: ‘#97CAE5’,
},
slide3: {
flex: 1,
justifyContent: ‘center’,
alignItems: ‘center’,
backgroundColor: ‘#92BBD9’,
},
text: {
color: ‘#fff’,
fontSize: 30,
fontWeight: ‘bold’,
}
});
- 【原创】东方耀reactnative 视频26之-react-native-swiper
- 【原创】东方耀reactnative 视频27之-react-native-swiper
- 【原创】东方耀reactnative 视频31之-开源导航组件 react-native-tab-navigator
- 【原创】东方耀reactnative 视频32之-开源导航组件 react-native-side-menu
- [原创]东方耀react native for android/ios视频学习
- 【原创】东方耀reactnative 视频12之-view组件
- 【原创】东方耀reactnative 视频13之-Text组件
- 【原创】东方耀reactnative 视频16,17之-TextInput组件
- 【原创】东方耀reactnative 视频18之-Touchable组件
- 【原创】东方耀reactnative 视频19之-图片image组件
- 【原创】东方耀reactnative 视频21之-ProgressBar
- 【原创】东方耀reactnative 视频22之-DrawerLayoutAndroid
- 【原创】东方耀reactnative 视频23之-ViewPageAndroid
- [原创]东方耀reactnative 视频29之-ListView组件
- 【原创】东方耀reactnative 视频38之-物理返回键
- 【原创】东方耀reactnative 视频26之-仿异步获取网络数据
- 【原创】东方耀react native学习之-37AsyncStorage
- 【原创】东方耀reactnative 视频14,15之- navigator/navigatorIOS组件
- 在Eclipse中安装JAD插件
- 【原创】东方耀reactnative 视频24之-ViewPagerAndroid做引导页
- 第二讲:Android 项目在Eclipse中的目录结构
- Linux中常用操作命令
- mysql5.7.xx 配置
- 【原创】东方耀reactnative 视频26之-react-native-swiper
- 比较Fragment中获取Context对象的两种方法
- CSS使得内容垂直居中
- RSS文件
- 好文章汇总
- 逻辑表达式
- iOS开发 适配iOS10以及Xcode8
- 第三讲 AndroidManifest.xml文件结构说明
- 纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)