福尔摩斯操作栏更改文字颜色 [英] Sherlock action bar change text color

查看:152
本文介绍了福尔摩斯操作栏更改文字颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的福尔​​摩斯操作栏版本4.1.0的(2012-05-17)的。
我怎样才能改变这个截图文本颜色的颜色?在实际的设​​备是barelly可读

我有这个主题

 <样式名称=MyTheme的父=@风格/ Theme.Sherlock.Light>
    <项目名称=机器人:TEXTSIZE> 20dp< /项目>
< /风格>

这在AndroidManifest.xml

 <应用
        机器人:名字=abc.MyApp
        机器人:图标=@绘制/ ic_launcher
        机器人:标志=@绘制/标志
        机器人:标签=@字符串/ APP_NAME
        机器人:主题=@风格/ MyTheme的
        >


解决方案

感谢这个答案:更改搜索查看的背景绘制小部件

  SearchManager的SearchManager的=(SearchManager的)a.getSystemService(Context.SEARCH_SERVICE);
搜索查看搜索查看=新android.widget.SearchView(a.getApplicationContext());
INT searchPlateId = searchView.getContext()getResources()则getIdentifier(机器人:ID / search_src_text,NULL,NULL);
//获取search_plate的LinearLayout。
AutoCompleteTextView searchPlate =(AutoCompleteTextView)searchView.findViewById(searchPlateId);
//设置'search_plate的背景前面定义绘制。
sea​​rchPlate.setTextColor(Color.BLACK);
...

I am using sherlock action bar Version 4.1.0 (2012-05-17). How can I change the color of the text color in this screenshot ? On the actual device it is barelly readable

i have this theme

<style name="MyTheme" parent="@style/Theme.Sherlock.Light">
    <item name="android:textSize">20dp</item> 
</style>

And this in AndroidManifest.xml

<application
        android:name="abc.MyApp"
        android:icon="@drawable/ic_launcher"
        android:logo="@drawable/logo"
        android:label="@string/app_name"
        android:theme="@style/MyTheme" 
        >

解决方案

thanks to this Answer To: Changing the background drawable of the searchview widget

SearchManager searchManager = (SearchManager) a.getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = new android.widget.SearchView(a.getApplicationContext());
int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
// Getting the 'search_plate' LinearLayout.
AutoCompleteTextView searchPlate = (AutoCompleteTextView) searchView.findViewById(searchPlateId);
// Setting background of 'search_plate' to earlier defined drawable.
searchPlate.setTextColor(Color.BLACK);
...

这篇关于福尔摩斯操作栏更改文字颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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