RN form TextInput usage

You should pay attention to Android and Apple are different Kazakhstan
Some attributes are unique to Apple, some of which are unique to Android has some two ha
// border to set two properties ha
borderColor: 'Pink',
marginTop: 10,
specific see address
https://reactnative.cn/docs/textinput.html#clearbuttonmode

import React, {Component} from 'react';
import {View, StyleSheet, TextInput} from 'react-native';
export default class demo2 extends Component {
  render() {
    return (
      <View>
        {/*  */}
        <TextInput
          isPassword={true}
          placeholder={'请输入用户名'}
          style={styles.input1}
          keyboardType={'visible-password'}
        />

        <TextInput
          keyboardType={'number-pad'}
          style={styles.input1}
          placeholder={'请输入密码'}
        />
      </View>
    );
  }
}
// 想要表单  出来还应该给图片宽高哈!!
const styles = StyleSheet.create({
  input1: {
    width: '100%',
    height: 45,
    // 边框要设置两个属性哈
    borderWidth: 1,
    borderColor: 'pink',
    marginTop: 10,
  },
});

Guess you like

Origin www.cnblogs.com/IwishIcould/p/12113418.html