gpt4 book ai didi

android - 如何允许粘贴到空的 EditText 中?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:13:19 25 4
gpt4 key购买 nike

当我长按空的 EditText 时,粘贴建议弹出窗口不会出现(确定为非空)。

XML

<EditText
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="right"
android:textSize="50sp"
android:inputType="numberDecimal"
android:id="@+id/text"/>

接触EditText的代码

editText.setRawInputType(InputType.TYPE_NULL);
if (Build.VERSION.SDK_INT >= 11) {
editText.setTextIsSelectable(true);
} else {
editText.setFocusable(true);
}

最佳答案

您是否尝试先复制数据?我只是在我自己的应用程序上尝试过,没有做任何事情,我在复制了一些东西后出现了折叠对话框。如果我没有复制任何内容,则不会弹出窗口(这是正常的)。

关于android - 如何允许粘贴到空的 EditText 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31746146/

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