【发布时间】:2014-03-29 05:33:40
【问题描述】:
如何将我的操作栏文本颜色从白色更改为黑色?我不想使用操作栏 Sherlock .
这是我的操作栏代码。
ActionBar ab = getActionBar();
ab.setDisplayUseLogoEnabled(false);
ab.setDisplayShowHomeEnabled(true);
ab.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
ab.setCustomView(R.layout.actionbar);
ab.setDisplayHomeAsUpEnabled(true);
ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#33CCFF"));
ab.setBackgroundDrawable(colorDrawable);
这是操作栏的自定义视图:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/title"
android:textColor="#ffffff"
android:textSize="24sp" />
</LinearLayout>
这里 style.xml :
<resources>
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
</style>
</resources>
我可以知道实现目标的正确方法是什么吗?也许这个问题太基础了,但我没有找到任何合适的解决方案。请帮帮我。
【问题讨论】:
-
你需要改变短语“SIGN UP”的颜色吗?
-
是的@kathir。我该如何改变?
-
如果是,将
TextView的文本颜色从#ffffff更改为#FF000000...
标签: android xml android-actionbar