2013-03-14 129 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