React Native Set Hint PlaceHolder Align Center Inside TextInput

The style’s attribute textAlign: ‘center’ is used to Set Hint PlaceHolder Align Center Inside TextInput component and also it can centralize the TextInput inside typed text. So let’s get started 🙂 .

Contents in this project Set Hint PlaceHolder Align Center Inside TextInput in React Native :

1. Import StyleSheet, View and TextInput component in your project.

2. Create a Root View in render’s return block.

3. Create the TextInput component in View. Now we would set the hint in TextInput using placeholder=””. We would also call the Custom style class TextInputStyle and inside the class we would call textAlign: ‘center’ attribute to center the Hint and Typed text align center.

4. Create Style for View and TextInput.

5. Complete source code for App.js File :

Screenshot in Android device :

Set Hint PlaceHolder Align Center

Screenshot in iOS device :

Leave a Reply

Your email address will not be published. Required fields are marked *