如何风格搜索查看的AppCompat下光标颜色 [英] How to style the cursor color of SearchView under AppCompat

查看:855
本文介绍了如何风格搜索查看的AppCompat下光标颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的搜索查看是android.support.v7.widget.SearchView和AppTheme如下表现。

My SearchView is android.support.v7.widget.SearchView and AppTheme is showed below.

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primary_dark</item>
    <item name="colorAccent">@color/color_accent</item>
</style>

<style name="AppTheme" parent="AppBaseTheme">
</style>

搜索查看的颜色似乎很奇怪,它的指针和底线表现出白色和反式口音的颜色很快,该如何处理呢?我想使光标和底线停留白色。

The color of SearchView seems strange, its cursor and bottom line showed white and trans to the accent color quickly, how to deal with it? I want to make the cursor and bottom line stay white.

推荐答案

如果你想改变的是搜索EDITTEXT的插入符/光标的颜色,你可以使用这样的:

If all you want to change is the color of the caret/cursor of the search-editText , you can use this :

<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
    <item name="actionBarTheme">@style/AppTheme.ActionBarTheme</item>
.... 

<style name="AppTheme.ActionBarTheme" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
    <item name="colorControlActivated">#FFffffff</item>
</style>

这篇关于如何风格搜索查看的AppCompat下光标颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆