Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Position of placeholder text in (multiline) TextInput for Android (React Native)

Tags:

react-native

I've got a multi-line TextInput like so:

<TextInput
  multiline={true}
  placeholder='Enter description...'
  underlineColorAndroid={'transparent'}
>

On iOS it renders the placeholder text nicely per this screenshot. enter image description here

On Android, it's putting the placeholder text as centered vertically! I've checked and there are no styles in any parent component that would force this behavior (again iOS is fine as per the screenshot).

Is there a way to justify that placeholder text to the top of the frame (same as iOS) ? enter image description here

like image 260
ajonno Avatar asked Dec 29 '16 10:12

ajonno


People also ask

How do you center a placeholder in TextInput react native?

To change TextInput placeHolder alignment with React Native, we can set the textAlign style to 'center' . to align the placeholder at the center of the screen by setting textAlign set to 'center' .


1 Answers

got it, used this prop: textAlignVertical={'top'}

like image 176
ajonno Avatar answered Oct 24 '22 06:10

ajonno