Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I vertically align text in text input at React Native?

I am new to React Native. Text in text input looks different on android and iOS. How do I vertically align text in text input?

My codes:

import React from "react"
import { TextInput } from "react-native"


export default function Signup() {

    return (
        <TextInput
            style={{ backgroundColor: 'red', height: 30, textAlignVertical: 'top' }}
        />
    )
}

Pictures:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

textAlignVertical is Android only.

Looks you problem may be solved with paddingBottom: <number>, or try setting lineHeight equal to fontSize.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading