2013-03-14 85 views
1

我想更改标题栏颜色。遵循指令here 或在AndroidManifest中使用Notitle栏消除标题栏不显示文本字体列表视图(我使用“simple_list_item_checked”listview)。更改标题栏结果不显示(字体问题)列表视图项目

下面是该活动的XML:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    android:background="#FFFAFA" 
    > 
<Button 
    android:id="@+id/btn" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@drawable/green_button" 
    android:text="@string/show_items_kfc" 
    android:onClick="onClick"/> 

<ListView 
    android:id="@+id/android:list" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 
</LinearLayout> 

(的XML代码的其余部分是与上述相同的链接)

本任何解决方案?

谢谢!

here the title bar is there and the list view also here I changed the title bar but in order to see the list view items I need to click on them first

+0

需要进一步解释。无法理解问题! – 2013-03-14 18:52:28

+0

你能看到图像吗?按照我所说的应用链接(为了改变背景标题栏颜色),结果也不显示列表视图项目。你可以在图像中看到。 – George 2013-03-14 18:53:59

+0

你在风格中应用了哪种颜色?它看起来textColor与背景颜色相同!分享xml代码和颜色。 – 2013-03-14 19:02:31

回答

1

如果我得到了问题:

而不是parent="android:Theme"

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="customTheme" parent="android:Theme"> 
     <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item> 
    </style> 
</resources> 

使用parent="android:Theme.Light"

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="customTheme" parent="android:Theme.Light"> 
     <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item> 
    </style> 
</resources> 

的问题是,要覆盖着黑色的背景和白色字母本地黑色主题。通过切换到Light主题你实现了黑色字母也有你自己的白色背景!

注意:之后,如果不符合您需要的UI,您可能必须将自定义主题颜色(例如,标题文本颜色强制为白色)修复为白色/黑色。

+0

:好的,谢谢!就是这样! – George 2013-03-15 09:13:21