React Native小知识点记录

1>查看 RN 的所有历史版本:

npm view react-native versions -json

2>查看 RN 的当前版本:

npm view react-native version -json

3>平台判断执行方法:

const Toolbar = Platform.select({
    android: () => renderToolbarAndroid(),
    ios: () => renderToolbarIOS()
  });

4>分隔线的高度不能写死0.5,否则有些机型会有问题,如下所示:

正确写法如下:

 container: {
        backgroundColor: 'white',
        borderTopWidth:StyleSheet.hairlineWidth,
        borderTopColor:'#ddd'
    },

5>View固定屏幕底部:

需要将view套在一个父view上,设置style如下:

addArticelBottmViewStyle: {
        position: 'absolute',
        width: Space.kScreenWidth,
        height: 44,
        bottom: 0,
        right: 0 // 可不要
    }

 

持续更新哟!!!

posted on 2017-08-08 15:11  玉思盈蝶  阅读(226)  评论(0编辑  收藏  举报

导航