我在我的 React Native 应用程序中使用
TextInput
。我希望将文本作为占位符,当用户单击 TextInput 时,该文本会动画化为左上角标签。下图中的 Company Name
标签显示了我想要的“左上角”标签。 React Native 中是否有任何组件(无论是本机 TextInput
还是其他组件)可以实现此目的?
它不是基础库的一部分,但是react-native-paper中的TextInput可以实现你想要的功能。
使用这个库 用于在文本输入中制作动画 :https://www.npmjs.com/package/@big-tam/react-native-animated-text-input