Closed
Description
If you assign a height
style to TextInput, on iOS the placeholder & actual text will render at the start of the container. However on Android, the placeholder & text will render at the center.
Code:
<TextInput
...
style={{ height: 100 }}
...
/>
Result:
I'd like to get Android to render at the start, but applying flex / alignItems / justifyContent styles don't seem to have any effect.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
fagerbua commentedon May 11, 2017
On Android, you need to set
textAlignVertical: "top"
in the style prop to TextInput. Not well documented.joncursi commentedon May 11, 2017
Thank you @fagerbua !
textAlignVertical: top
in the doc #14022pandiaraj44 commentedon Jul 31, 2017
Thanks, @fagerbua,
I have tried with align-items, justify-content and text align but nothing worked. After adding textAlignVertical: "top", It's worked.
Really, Awesome.
luck2011 commentedon Sep 29, 2017
Thanks! Saved my day @fagerbua
yanhaijing commentedon Oct 13, 2017
thanks
iamtekeste commentedon Oct 20, 2017
Thanks @fagerbua !!! I spent almost half a day trying to figure it out!
fagerbua commentedon Oct 25, 2017
Issue closed, but should the default behavior on Android and iOS differ like this? If not, perhaps this should be re-opened as a bug report?
mattyclarkson commentedon May 17, 2018
It's also really annoying that you cannot do the opposite on iOS, i.e put
textAlignVertical: 'center'
and get the Android behaviour. It's supported by the native widget