【问题标题】:Android creating themes and stylesAndroid 创建主题和样式
【发布时间】:2010-07-26 22:26:27
【问题描述】:

我想为我的第一个 Android 应用定义一个主题。我使用 Eclipse 并关注 this tutorial 但有问题。

步骤:

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 总是抱怨 item name="SplashScreen" 节点并显示消息“No resource found...”。我只是想让 SplashScreen 调用 default_splashScreen 样式。

怎么了? 谢谢!

【问题讨论】:

    标签: android eclipse themes styles styling


    【解决方案1】:

    Eclipse 只是在文本编辑器中抱怨,还是在您实际尝试编译和运行应用程序时抱怨?也许 Eclipse 没有正确更新项目 - 请尝试以下方法之一:

    • 您是否将项目设置为“自动构建”?
    • 尝试手动刷新项目? (右键单击项目/刷新)
    • 通过菜单清理项目 >​​ 项目清理项目...
    • 最后:重启 Eclipse

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-29
      • 1970-01-01
      • 2017-06-14
      • 2015-09-16
      相关资源
      最近更新 更多