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:
textAlignVertical is Android only.
Looks you problem may be solved with paddingBottom: <number>
, or try setting lineHeight
equal to fontSize
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.