在文字输入上水平滚动 [英] Horizontal scroll on text input

查看:112
本文介绍了在文字输入上水平滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个输入文字.首先是一封电子邮件,当我写的文本多于此输入的宽度时,问题就来了,其余的文本看不到.正常的行为是水平滚动以查看文本的其余部分,对吧?

I got two input text. First one is for an email, the problem comes when I write more text than the width of this input, the rest of the text doesn't see. The normal behavior would be scroll horizontally to see the rest of the text, right?

我不知道我是否缺少某些东西,但这不起作用.

I don't know if I'm missing something, but it doesn't work.

以下是示例代码: rnplay.org

这是我想得到的效果,这是来自官方React Native存储库的UI Explorer示例:

This is the effect I wanna get, this is from UI Explorer Example from official React Native repo:

谢谢!

推荐答案

我能够解决它.

我不知道为什么,但是如果我将 paddingTop paddingBottom 都设置为输入文本,就会出现问题.

I don't know why, but the problem comes if I have set both paddingTop and paddingBottom to the input text.

如果我删除其中之一,则输入文本效果很好,下面是一个示例:输入文本效果很好

If I remove one of them, then the input text works perfectly, here is an example: Input text working well

我希望这也可以对某人有所帮助.

I hope this can help someone too.

谢谢.

这篇关于在文字输入上水平滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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