#### 通用屬性
placeholder
> 默認提示字符串, 如果沒有任何輸入, 將顯示.
multiline
> 如果為 true, 文本框可以輸入多行. 默認為 false.
secureTextEntry
> 安全輸入, 通常用于密碼之類, 如果為 true, 文本框將不顯示明文. 默認為 false.
* * * * *
#### 安卓常用屬性
underlineColorAndroid={'transparent'}
> 文本框的下劃線顏色, 如果要取消文本框的邊框, 請設置屬性為 transparent.
* * * * *
#### ios常用屬性
clearButtonMode 'never', 'while-editing', 'unless-editing', 'always'
> 是否在文本框內的右邊顯示 清除 的按鈕.
## 簡單的實例
~~~
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TextInput
} from 'react-native';
export default class code extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.innerView}>
<Text style={{color:'#333'}}>普通輸入框</Text>
<TextInput style={styles.inputStyle} underlineColorAndroid={'transparent'} />
</View>
<View style={styles.innerView}>
<Text style={{color:'#333'}}>密碼框</Text>
<TextInput style={styles.inputStyle} secureTextEntry={true} />
</View>
<View style={styles.innerView}>
<Text style={{color:'#333'}}>placeholder</Text>
<TextInput style={styles.inputStyle} placeholder='請輸入內容' />
</View>
<View style={styles.innerView}>
<Text style={{color:'#333'}}>多行文本</Text>
<TextInput style={styles.inputStyle2} multiline ={true} placeholder='多行文本' />
</View>
<View style={styles.innerView}>
<Text style={{color:'#333'}}>數字鍵盤</Text>
<TextInput style={styles.inputStyle} keyboardType={'numeric'} />
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f7f7f7',
},
innerView:{
padding:10
},
inputStyle:{
width:300,
height:40,
borderWidth:1,
borderColor:'#ccc',
backgroundColor:'#fff',
},
inputStyle2:{
width:300,
height:60,
borderWidth:1,
borderColor:'#ccc',
backgroundColor:'#fff'
}
});
AppRegistry.registerComponent('code', () => code);
~~~