Flex 布局:
flexDirection
alignItems
justifyContent
ActivityIndicator:
animating
color
size
(small, large) Android 情况下可以输入 numberhidesWhenStopped
(iOS,当停止时,是否隐藏,默认是true)
Button:
color
disable
title
onPress
DatePickerIOS:
date
maximumDate
minimumDate
minuteInterval
(分钟单位, 1,2,3,4,5,6,10,12,15,20,30)mode
(date, time, datetime)timeZoneOffsetInMinutes
onDateChange
Text:
numberOfLines
onPress
textAlign
- 后续的样式会覆盖之前的样式
TextInput:
autoCapitalize
转换大写- characters 所有字符
- words 每个单词的首字符
- sentences 每句话的首字符
- none
autoCorrect
拼写自动修正autoFocus
自动响应defaultValue
editable
keyboardType
maxLength
multiline
placeholder
placeholderTextColor
secureTextEntry
value
clearButtonMode
(iOS)- never
- while-editing
- unless-editing
- always
keyboardAppearance
(iOS)- default/light/dark
returnKeyType
onChange
onChangeText
onEndEditing
onSubmitEditing
ListView:
dataSource
renderRow
Navigator:
initialRoute
123456789initialRoute={{title: '导航',index: 0,component: MainView /*导航器的视图页面*/params: {}}}
renderScene
12345678renderScene={(route, navigator) => {let Component = route.component;return <Component{...route.params}navigator={navigator}/>}}
NavigatorIOS:
initialRoute
123456789101112131415161718192021221. 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()}}interactivePopGestureEnabled
navigationBarHidden
: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上的placeholderonProgress
iOS 监听下载进度
TabBarIOS:
barTintColor
bar背景tintColor
标签被选中之后的颜色unselectedTintColor
标签未选中的颜色(待定)translucent
是否半透明化
TabBarIOS.Item:
badge
title
renderAsOriginal
配合icon使用selectedIcon
icon
图标,当设置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
|
|