Android creating themes and styles
I would li开发者_如何转开发ke 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!
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:
- have you set your project to 'Build automatically'?
- tried a manual project refresh? (right click on project / refresh)
- clean the project via Menu > Project Clean Project...
- finally: restart Eclipse
精彩评论