我试图为我的EditText获得两种不同的颜色类型 . 一个应该是“主要”而另一个应该是“重音”颜色 .
我将styles.xml文件编辑为:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorAccent">@android:color/white</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/primaryDark</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/primaryDark</item>
</style>
</resources>
但是我只获得了我的编辑句柄,并且cursorto是纯白色,并突出显示选择背景50%白色 . 只是强调色 . 这很好,看起来像这样:
但是,我还需要将高亮标记设置为主要颜色的50%,将光标设置为实心原色,并将处理设置为原始颜色 . 如此处所示,我无法完成此操作,并且光标和编辑句柄是“白色”,因此它们是不可见的:
无论如何得到两个主题的EditTexts?
1 回答
在EditText上使用
android:theme
:和你的自定义EditText主题: