React-Native TextInput组件详解及实例代码

网络编程 2021-07-04 20:00www.168986.cn编程入门
这篇文章主要介绍了React-Native TextInput组件详解及实例代码的相关资料,需要的朋友可以参考下

适配Android和IOS

代码注释比较详细

/
  Sample React Native App
  https://github./facebook/react-native
  @flow
 /

import React, {Component} from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TextInput,
  Platform,
  TouchableOpacity,
} from 'react-native';

//获取屏幕信息
var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;

class TextInputG extends Component {

  render() {
    return (
      <View style={styles.container}>

        {/账号输入框在这里用View包裹以便处理器样式 

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by