0.0.5 • Published 7 years ago

runnercamp-shop v0.0.5

Weekly downloads
21
License
-
Repository
-
Last release
7 years ago

开始

文档

React Native (官方) React Native (汉化 v0.31) 项目文档

开发环境

IDE 推荐用 Atom + Nuclide(facebook提供的 atom 插件)

apm install nuclide

入坑指南

  • 所有的宽度、高度、字体等数值,都需要用 $px(100) 的方式

    const styles = StyleSheet.create({
        bigbutton: {
            height: $px(40)             // 宽度
        },
        bigbuttonText: {
            marginLeft: $px(24) ,       // <<-- margin
            fontSize: $px(11) ,         // <<-- 字体
        }
    })

    以及 JSX 中:

    <View style={{width: $px(100)}}> ... </View>
  • ListView 外面要套一层 View, 否则无法靠 width 指定一个固定宽度

    <ListView style={{width:100}} />

    改为:

    <View style={{width:100}}>
        <ListView />
    </View>

Android

  • Genymotion 安装好以后,需要给 ADB 设置 Android SDK 的路径,否则 Genymotion 自带的 SDK 和编译用的版本不一致,无法运行。

  • 由于当前的renact-native 的字体大小会跟随系统的设置变化而变化,因为这个原因导致我们界面会因此发生一些排版问题,再此就把react-native 版本号为0.37.0 修改了RCTFont.mm文件中的缩放比例,路径改成了我自己的 以后大家直接 npm install。