Android 创建主题和样式
我想为我的第一个 Android 应用程序定义一个主题。我使用 Eclipse 并遵循本教程但有问题。
步骤:
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. 我创建包含内容的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>
现在Eclipse 总是抱怨项目名称=“SplashScreen”节点并显示消息“未找到资源.. .”。我只想 SplashScreen 调用 default_splashScreen 样式。
怎么了? 谢谢!
I would like to define a theme for my first Android app. I use Eclipse and I follow this tutorial but have problems.
Steps:
A. I create the values/styles.xml file with content
<?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
<?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...". I just want SplashScreen to call default_splashScreen style.
What is wrong?
Thx!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Eclipse 仅在文本编辑器中抱怨,还是在您实际尝试编译和运行应用程序时抱怨?也许 Eclipse 没有正确更新项目 - 请尝试以下操作之一:
Is Eclipse only complaining in the text editor or also when you actually try to compile and run the app? Maybe Eclipse doesn't update the project correctly - try one of the following: