
Flex 布局:
flexDirectionalignItemsjustifyContent
ActivityIndicator:
animatingcolorsize(small, large) Android 情况下可以输入 numberhidesWhenStopped(iOS,当停止时,是否隐藏,默认是true)
Button:
colordisabletitle
onPress
DatePickerIOS:
datemaximumDateminimumDateminuteInterval(分钟单位, 1,2,3,4,5,6,10,12,15,20,30)mode(date, time, datetime)timeZoneOffsetInMinutes
onDateChange
Text:
numberOfLinesonPresstextAlign- 后续的样式会覆盖之前的样式
TextInput:
autoCapitalize转换大写- characters 所有字符
- words 每个单词的首字符
- sentences 每句话的首字符
- none
autoCorrect拼写自动修正autoFocus自动响应defaultValueeditablekeyboardTypemaxLengthmultilineplaceholderplaceholderTextColorsecureTextEntryvalueclearButtonMode(iOS)- never
- while-editing
- unless-editing
- always
keyboardAppearance(iOS)- default/light/dark
returnKeyType
onChangeonChangeTextonEndEditingonSubmitEditing
ListView:
dataSourcerenderRow
Navigator:
initialRoute123456789initialRoute={{title: '导航',index: 0,component: MainView /*导航器的视图页面*/params: {}}}
renderScene12345678renderScene={(route, navigator) => {let Component = route.component;return <Component{...route.params}navigator={navigator}/>}}
NavigatorIOS:
initialRoute123456789101112131415161718192021221. component:2. title:3. titleImage: require('./img/icon1.png')4. passProps:参数传递,跟上面区分5. backButtonTitle:6. backButtonIcon:7. leftButtonTitle:8. onLeftButtonPress:9. navigationBarHidden:10. shadowHidden:11. tintColor:12. titleTextColor:13. translucent:{leftButtonTitle: 'back',rightButtonIcon: (require('./img/left.png')),onLeftButtonPress: ()=>{this.props.navigator.pop()}}interactivePopGestureEnablednavigationBarHidden:shadowHidden:tintColor:titleTextColor:translucent:
- push(route)
- popN(number)
- pop()
- popToTop()
state:
this.state = { };this.setState({});
Image:
resizeMode:- cover(覆盖容器)
- contain(适合容器)
- stretch(充满)
source:使用静态图片时,不需要指定大小style
1<Image source = {require('./icon.png')} />js 使用app中的图片资源需要设置大小style
1<Image source={{uri: 'app_icon'}} style={{width: 40, height: 40}} />网络图片同上,也需要设置size
defaultSource, iOS上的placeholderonProgressiOS 监听下载进度
TabBarIOS:
barTintColorbar背景tintColor标签被选中之后的颜色unselectedTintColor标签未选中的颜色(待定)translucent是否半透明化
TabBarIOS.Item:
badgetitlerenderAsOriginal配合icon使用selectedIconicon图标,当设置systemIcon时,icon无效果systemIcon(‘bookmarks’, ‘contacts’, ‘downloads’, ‘favorites’, ‘featured’, ‘history’, ‘more’, ‘most-recent’, ‘most-viewed’, ‘recents’, ‘search’, ‘top-rated’)selected当前标签选中状态,1selected={this.state.selectedTab === '当前tab'}onPress
|
|