gpt4 book ai didi

android - 在 AlertDialog 上复制/粘贴带有奇怪矩形的菜单

转载 作者:行者123 更新时间:2023-11-29 01:08:48 25 4
gpt4 key购买 nike

我正在用这个自定义 View 创建一个 AlertDialog:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

这是我用来创建和显示对话框的代码:

AlertDialog.Builder builder;
builder = new AlertDialog.Builder(getActivity());

LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.edit_text_layout, null);
builder.setView(dialogView);
builder.create().show();

当我尝试从我的 EditText 复制一些文本时,复制/粘贴菜单会出现一个奇怪的矩形,它隐藏了 EditText。

enter image description here

我已经在 Marshmallow 和 Nougat 上测试过,两者都有同样的问题

最佳答案

正如它提到的here ,问题与​​样式有关。在这种情况下,从我的自定义 AlertDialog 样式中删除 bacgkround 颜色项目解决了这个问题。

关于android - 在 AlertDialog 上复制/粘贴带有奇怪矩形的菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44888366/

25 4 0