[英]Android creating themes and styles
I would like to define a theme for my first Android app. 我想为我的第一个Android应用程序定义一个主题。 I use Eclipse and I follow this tutorial but have problems. 我使用Eclipse,并且遵循本教程,但是有问题。
Steps: 脚步:
A. I create the values/styles.xml file with content A.我创建带有内容的values / styles.xml文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="default_splashScreen">
<item name="android:background">@drawable/bg</item>
</style>
</resources>
B. I create the values/themes.xml file with content B.我创建带有内容的values / themes.xml文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme" parent="android:Theme">
<item name="SplashScreen">@style/default_splashScreen</item>
</style>
</resources>
Now Eclipse always complains about the item name="SplashScreen" node with the message "No resource found...". 现在,Eclipse总是抱怨项目名称为“ SplashScreen”的节点,并显示消息“找不到资源...”。 I just want SplashScreen to call default_splashScreen style. 我只希望SplashScreen调用default_splashScreen样式。
What is wrong? 怎么了? Thx! 谢谢!
Is Eclipse only complaining in the text editor or also when you actually try to compile and run the app? Eclipse是仅在文本编辑器中抱怨还是在实际尝试编译和运行应用程序时抱怨? Maybe Eclipse doesn't update the project correctly - try one of the following: 也许Eclipse无法正确更新项目-请尝试以下操作之一:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.