/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Image,
Text,
TouchableHighlight,
TextInput,
View
} from 'react-native';
export default class ViewProject extends Component {
render() {
return (
<View style={styles.container}>
<TextInput style={styles.textInputStyle}
underlineColorAndroid='transparent' //设置下划线背景色透明 达到去掉下划线的效果
defaultValue='Ajfg你好'
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex:1,
justifyContent: 'center',
alignItems:'center',
backgroundColor:'grey'
},
textInputStyle:{
width:400,
height:80,
fontSize:30,
alignItems: 'center',
justifyContent: 'center',
backgroundColor:'white'
}
});
AppRegistry.registerComponent('ViewProject', () => ViewProject);
去掉下划线 后