SmitSherlock
SmitSherlock

Reputation: 61

How to place a Icon inside textinput in react native

I have app in react native.In my app, I have two textinput , i want to set icon inside textinput.Icon can be any react native vector icons,especially "marker" or "location marker"..Can anyone tell me how to do that??????

Upvotes: 1

Views: 10314

Answers (1)

Fran Rios
Fran Rios

Reputation: 821

Use react-native-vector-icons as you can render it inside a text component. But if you want to use it as if it were inside a TextInput you have to wrap Icon and TextInput inside a View:

<View>
  <Icon ... />
  <TextInput ... />
</View>

Then you can do something like this: enter image description here

Upvotes: 1

Related Questions