gpt4 book ai didi

react-native - React Native - 当 TextInput 中的文本比 TextInput 长且不在焦点时出现三个点

转载 作者:行者123 更新时间:2023-12-03 13:42:35 28 4
gpt4 key购买 nike

所以我会试着解释我的场景。

我有一个单行 TextInput .当用户是 onFocus ,文内TextInput可以长于 TextInput本身。

但是,当用户不再onFocus ,Android 和 iOS 的行为不同。

iOS:
三个点被添加到行尾并显示文本的开头。

enter image description here

安卓:
不做任何更改。

Behaviour in Android

对于这种特定情况,如何使 Android 中的 TextInput 表现得像在 iOS 中一样?

谢谢

最佳答案

我不知道你有没有答案,但椭圆模式行数 将有助于此查询。

          <TextInput
ellipsizeMode="tail"
numberOfLines={1}
ref={(textInput) => { this.textInput = textInput; }}
style={}
placeholder="Type a message..."
onSubmitEditing={}
onChange={}
/>

关于react-native - React Native - 当 TextInput 中的文本比 TextInput 长且不在焦点时出现三个点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44879853/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com