0

I'm using react-native-material-textfield instead of react-native TextInput.

enter image description here

some problems:

1) How can I remove border right/left/top?

2) How can I change the color/font-size of the label( here is phone number)?

I tried (inputContainerStyle,labelTextStyle,titleTextStyle) to change but it dose not affect.

  <OutlinedTextField
    autoCorrect={false}
    enablesReturnKeyAutomatically={true}
    label='Phone number'
    keyboardType='phone-pad'
    formatText={formatText}
    labelTextStyle={{color:'red'}}
    onSubmitEditing={onSubmit}
    ref={fieldRef}
  />

1 Answers1

0
  1. You shouldn't be using 'OutlinedTextField' for that - use 'TextField'.

  2. Use the param 'baseColor' to change the color of the label when in default state, 'tintColor' to change color when in focused state, 'errorColor' to change color of error, and 'textColor' to change color of typing text.

    <TextField
        autoCorrect={false}
        enablesReturnKeyAutomatically={true}
        label='Phone number'
        keyboardType='phone-pad'
        formatText={formatText}
        baseColor='red'
        tintColor='red'
        onSubmitEditing={onSubmit}
        ref={fieldRef}
      />
    
    
Jeff Padgett
  • 2,380
  • 22
  • 34