加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

React Native 之 TextInput组件去掉下划线

发布时间:2020-12-15 05:08:44 所属栏目:百科 来源:网络整理
导读:/** * 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 cla
/**
 * 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',backgroundColor:'white'
  }
});
AppRegistry.registerComponent('ViewProject',() => ViewProject);

去掉下划线 后

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读