gpt4 book ai didi

android - 使用 setUseNativeTextInput(false) 时,Android 上的 TextField 中的文本乱码;

转载 作者:行者123 更新时间:2023-11-30 05:11:50 25 4
gpt4 key购买 nike

使用“TextField.setUseNativeTextInput(false)”时,TextFields 中的文本在编辑时会被打乱。看起来有两个文本放在彼此之上:原始文本和正在编辑的文本。

此问题出现在 Android 上,但不会出现在模拟器中。在模拟器中,两个文本似乎都放在彼此之上(稍微移位),但两个文本都在被编辑。

可以使用下面的表格复制问题。

亲切的问候,弗兰斯

import com.codename1.ui.Form;
import com.codename1.ui.Label;
import com.codename1.ui.TextArea;
import com.codename1.ui.TextField;
import com.codename1.ui.layouts.BoxLayout;

public class TextFieldWithTextForm extends Form
{
public TextFieldWithTextForm()
{
super("TextField with text", BoxLayout.y());
TextField.setUseNativeTextInput(false);
add(new Label("Remove the 4 and the k from the fields below"));
TextField one = new TextField("", "This field one", 20, TextArea.ANY);
one.setText("0123456789");
add(one);
TextField two = new TextField("", "This field two", 20, TextArea.ANY);
two.setText("abcedfghijklmnopqrstuvwxyz");
add(two);
}
}

最佳答案

我们现在弃用了这个调用,它之前应该被弃用,因为它可以追溯到不再支持的实现。

关于android - 使用 setUseNativeTextInput(false) 时,Android 上的 TextField 中的文本乱码;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53595264/

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