先有框架,再有章節(jié),入門先從組件,樣式,api調(diào)用 三方面入手,類比其他語言的 視圖,樣式,數(shù)據(jù)處理
1、組件
常用組件
<View> <Text> <Image>
<ScrollView> <TextInput> <StyleSheet>
交互組件
<Button><Picker 選擇欄><Slider 滑條選擇><Switch 開關>
列表視圖
<FlatList><SectiionList 帶分組的列表>
其他組件
<ActivityIndicator 加載視圖><Alert 提示框>
<Animated 動畫> <CameraRoll 訪問相冊>
<Dimensions 設備尺寸> <KeyboardAvoidingView 隨鍵盤彈起> <Linking 通用的接口調(diào)起其他應用><Modal 模態(tài)視圖> <PixelRatio 獲取設備像素> <RefreshControl 添加下拉刷新功能><StatusBar 控制頂部狀態(tài)欄組件> <WebView 顯示web內(nèi)容>
2、樣式
style={{
backgroundColor: '#f9c2ff',
height: 40,
width:
left:
top:
margin:
fontSize:
padding: 20,
marginVertical: 8,
marginHorizontal: 16,
borderColor: 'gray',
borderWidth: 1
...
}}
3、api
https://reactnative.cn/docs/accessibilityinfo