2010-07-26 83 views
0

我想爲我的第一個Android應用定義主題。我使用Eclipse,我遵循this tutorial但有問題。Android創建主題和樣式

步驟:與內容

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

答:我創建值/ styles.xml與內容文件

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="default_splashScreen"> 
    <item name="android:background">@drawable/bg</item> 
    </style> 
</resources> 

B.我創造價值/的themes.xml文件現在Eclipse始終抱怨項目名稱=「SplashScreen」節點,並顯示消息「找不到資源...」。我只想讓SplashScreen調用default_splashScreen樣式。

出了什麼問題? Thx!

+0

我找到了解決辦法! – xpepermint 2010-07-27 09:57:32

回答

1

Eclipse是隻在文本編輯器中抱怨,還是當你真的試圖編譯和運行應用程序?也許Eclipse不會正確更新項目 - 請嘗試以下操作之一:

  • 您是否已將項目設置爲「自動生成」?
  • 嘗試手動項目刷新? (右鍵單擊項目/刷新)
  • 通過菜單>項目清理項目清理項目...
  • 最後:重新啓動Eclipse
+0

我做到了,但沒有運氣。 – xpepermint 2010-07-27 06:26:47