2010-07-26 65 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