1.安装 cnpm i expo-cli -greact
2.expo init rn-basic 建立一个新项目npm
3.项目启动 yarn startthis
4.基本组件spa
View(至关于div)blog
Text(至关于span,p)事件
StyleSheet(样式)ci
Propsit
Statecli
Style (小驼峰,不加引号,没有单位,没有复合属性的写法)(颜色属性仍是要加引号的)cnpm
Width&&Height
TextInput (keyboardType={'numeric'} 键盘类型为数字键盘)
Handling Touches
)
5.hello world(100不要加px)
6.constructor在子类调用时,父类也会调用
若是要在子类的constructor里使用this, 必须调用父类的constructor
若是不这样作,就拿不到this
如何调用父类的constructor? super()
若是要在constructor里使用父组件传递过来的参数,必须在调用父组件super时,传递参数给父组件的constructor
若是你不在constructor里边使用this,或是参数,就不须要super
由于react已经帮你作了this, props的绑定
7.TouchableHighlight TouchableNativeFeedback TouchableOpacity TouchableWithoutFeedback
onpress 点击事件
8.Flatlist
9.Networking