0

我在 /kopiMapReportGeneration/WebContent/VAADIN/themes 中有我的 VAADIN 应用程序的自定义主题我想更改 style.css 中的进度指示符:

.v-loading-indicator, .v-loading-indicator-delay, .v-loading-indicator-wait {
   width: 100%;
   height: 100%;
   margin: 0;
   background-position: 50%;
   background-image: url("../customThemes/img/progress.gif");
   background-color: gray;
   opacity: .8;
   -ms-filter: alpha(opacity=80);
   filter: alpha(opacity=80);
   background-repeat: no-repeat; 
   background-attachment: fixed; 
}

这是图像路径/WebContent/VAADIN/themes/customThemes/img/progress.gif 问题是没有考虑css更改。

4

1 回答 1

4

我有几点:

  1. style.css已缓存,因此在对 CSS 进行任何更改后,您应该清除浏览器缓存以获取新style.css资源。
  2. 你的应用程序和主窗口应该有setTheme("customThemes");
  3. background-image: url("img/progress.gif");就足够了,但background-image: url("../customThemes/img/progress.gif");也应该工作。

定影:

  1. 通过 Inspect element 搜索您的 html 页面中的<link rel="stylesheet" type="text/css" href="/context-if-any/VAADIN/themes/customThemes/styles.css">inHEAD元素。它应该在那里。
  2. 访问css资源并确保它是最新的并且没有被缓存
  3. 确保您的/context-if-any/VAADIN/themes/customThemes/img/progress.gif资源可以通过网络浏览器访问

结论:

如果修复 1 已链接其他主题。-> 在您的应用程序中试验 setTheme() 方法

如果修复 2 有缓存的 css 资源。按 ctrl + F5 硬刷新或清除浏览器缓存。

如果修复 3 出错,则您的自定义主题不可用。确保将资源打包到最终战争中。

于 2013-08-22T09:46:03.293 回答