1

I have a TextInput with rounded corners :

<TextInput
    style={{
        backgroundColor : '#FFFFFF',
        borderRadius : 30,
        marginLeft : 8,
        marginRight : 8,
        marginTop : 10
    }}
    placeholder = 'A placeholder'
/>

but i would like to give some left padding to placeholder (and text that will be contained inside TextInput), because now text is too near to left TextInput border. How can i do it?

giozh
  • 9,868
  • 30
  • 102
  • 183

2 Answers2

7

Instead of marginLeft use paddingLeft

<TextInput
    style={{
          backgroundColor: '#ffffff',
          borderRadius: 30,
          paddingLeft: 8,
          paddingRight: 8,
          marginTop: 10
        }}
        placeholder='A placeholder'
      />

I hope this will help

Vishal Rabadiya
  • 495
  • 5
  • 24
4

You can use it

paddingHorizontal: 10
Siddhartha Mukherjee
  • 2,703
  • 2
  • 24
  • 29