我为我的EditText视图创建了一个拖放函数。我使用的代码与谷歌官方教程相同。
当我把一些东西放到EditText中时,它总是在EditText上显示一个突出显示。我尝试过将drophelper.Options.Builder() setHighlightColor
设置为透明的,但是高亮区域只是改变了颜色。
有人知道如何禁用下拉高亮显示吗?
谢谢你的帮助。
发布于 2022-06-15 07:08:00
您可以添加一些不同的颜色,即透明的whte
android:textColorHighlight="#00FFFFFF"
或者这个
android:background="#00000000"
并禁用默认高亮显示。
android:defaultFocusHighlightEnabled="false"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/text_view_id"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/hello"
android:defaultFocusHighlightEnabled="false"
android:textColorHighlight="#00FFFFFF" />
</LinearLayout>
自动填充框架
如果您可以使用android:autofillHints
属性,那么重点也可能更多地归功于Android的自动填充框架。若要覆盖突出显示设置,请执行以下操作:
应用程序主题android:autofilledHighlight
中的
https://stackoverflow.com/questions/72627129
复制相似问题