React-native 如何在 textinput 上向上移动屏幕 [英] React-native how to move screen up on textinput

查看:120
本文介绍了React-native 如何在 textinput 上向上移动屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 react-native 创建的登录屏幕.

I have a login screen created using react-native.

当用户在 textInput 中输入时,如何将我的屏幕向上移动?

How can I shift my screen up when the user is typing in the textInput?

我是否会监听 onFocus() 事件并使用 css 样式来更改视图的样式?

Do I listen to the onFocus() event and use css styling to change the style of the view?

推荐答案

在 2017 (RN 0.43) 中有一个特殊的组件:KeyboardAvoidingView

In 2017 (RN 0.43) there is special component for this: KeyboardAvoidingView

这篇关于React-native 如何在 textinput 上向上移动屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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