【发布时间】:2016-09-18 12:24:58
【问题描述】:
我知道这个问题已经得到解答,但我找不到有效的解决方案。
在 android 上 > lolipop (21) 是否有任何方法可以更改我的文本选择句柄的颜色(无需上传新的 png 图像)?
我定义了这种风格
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppEditTextStyle" parent="@android:style/Widget.Material.Light.EditText">
<item name="android:background">@null</item>
<item name="android:textCursorDrawable">@null</item>
<item name="android:drawableTint">#00ffffff</item>
</style>
<style name="AppTheme" parent="@android:style/Theme.Material.Light.NoActionBar">
<item name="android:editTextStyle">@style/AppEditTextStyle</item>
</style>
</resources>
但这不起作用,我收到: 错误:找不到与给定名称匹配的资源:attr 'android:drawableTint'。
但在文档 (https://developer.android.com/reference/android/widget/TextView.html#attr_android:drawableTint) 中明确指出存在 android:drawableTint :( 所以我不明白为什么我想念?
【问题讨论】:
-
洛基这可能会对你有所帮助。 stackoverflow.com/questions/29795197/…
-
感谢 W4R10CK 但没有 :( 我不想这样做
- @drawable/text_select_handle_middle
因为我知道在 android > 21 上它们是在不上传新绘图的情况下更改颜色的方法。我现在不明白为什么- #00ffffff
返回错误:(
标签: android android-edittext android-theme android-styles