React Native Textinput:有没有办法将占位符动画化为标签?

问题描述 投票:0回答:2

我在我的 React Native 应用程序中使用

TextInput
。我希望将文本作为占位符,当用户单击 TextInput 时,该文本会动画化为左上角标签。下图中的
Company Name
标签显示了我想要的“左上角”标签。 React Native 中是否有任何组件(无论是本机
TextInput
还是其他组件)可以实现此目的?

enter image description here

react-native textinput react-native-textinput
2个回答
0
投票

它不是基础库的一部分,但是react-native-paper中的TextInput可以实现你想要的功能。


0
投票

使用这个库 用于在文本输入中制作动画 :https://www.npmjs.com/package/@big-tam/react-native-animated-text-input

© www.soinside.com 2019 - 2024. All rights reserved.