要改主轴的方向node
flexDirection:"row",justifyContent:"center"}
要铺满用flex:1 .
若是发面没有铺满,居中显示了。有多是设置了交叉轴的对齐方式。
检查alignItems有没有设置值。react
用的是Swipper组件。须要先引用npm
import Swiper from 'react-native-swiper';
autoplay={this.props.autoplay} //组件里使用 autoplay={false} //调用的时候这样显示 //传自定义的属性值 dtList={this.state.dataList} //接收时 dataList={this.props.dtList} //是否显示左右箭头 showsButtons=true //默认不显示 //是否自动播放 autoplay=true //是否显示图片下方的小圆点 showsPagination={false} //dot 小圆点的样式 ,里面是view包装的style . //activeDot 点中的样式
--save的做用是:配置package.json,至关于Android的gradle,咱们依赖的库在node-modules,至关于Android的libs文件夹,json
map()方法返回一个新数组,数组中的元素为原始数组元素调用函数处理的后值react-native
image source的指向问题。 本地路径用require .网上的用uri数组
<Image source={require("../../../Image/icon_right.png")} style={{width:20,height:20}}/>