如何正确对齐文本输入本地? [英] How to align text input correctly in react native?

查看:121
本文介绍了如何正确对齐文本输入本地?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文本输入是居中对齐的,如何修复此文本输入以便从左上角输入

The Text input is center aligned, how to fix this text input so that it takes input from top left corner

这是我的文本输入css

Here is my css for text input

/* The Text input is center aligned, how to fix this text input so that it takes input from top left corner */

input: {
  flex: 1, padding: 4, marginRight: 1, marginTop: 5, fontSize: 18, borderWidth: 1, borderRadius: 4, borderColor: '#E6E5ED', backgroundColor: '#F8F8F9', justifyContent: 'flex-start', height: 150
}


推荐答案

我遇到了同样的问题,但上述说明没有解决。有一个仅限机器人的样式属性 textAlignVertical 修复此问题的多线输入。

I had the same issue, but the above notes didn't solve it. There's an android-only style property textAlignVertical that fixes this issue on multiline inputs.

ie textAlignVertical:'top'

这篇关于如何正确对齐文本输入本地?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆