Cordova为Android设置背景图像
我正在使用 cordova 和 jquery mobile 开发一个 android 应用程序。如何在此应用程序中设置背景图像?我需要在所有页面中放置背景图像...
这是我的代码..看到我只有一个 html 页面,下面的代码出现在该 html 页面中..它也代表一个页面..我在一个 html 页面中有 6 个这样的页面..我想在这 6 个页面中放置背景图像。
<div data-role="page" id="home_page" data-content-theme="a" style="background-image:url(images/back.jpg)" >
<div data-role="header">
<div data-role="navbar">
<ul>
<li><a href="#about_us_page" id="products" data-transition="none">About</a></li>
<li><a href="#purpose_page" id="projects" data-transition="none">Purpose</a></li>
<li><a href="#design_page" id="awards" data-transition="none">Design</a></li>
</ul>
</div>
出口
<p align="justify">content content.....</p>
<div data-role="footer" style="position:absolute;bottom:0px;" class="footer">
<div data-role="navbar">
<ul>
<li><a href="#construction_page" id="about_us" data-transition="none">Construction</a></li>
<li><a href="#issues_page" id="contacts" data-transition="none">Issues</a></li>
<li><a href="#share_page" id="locations" data-transition="none">Share</a></li>
</ul>
</div>
</div>
在这里,我在开始的 div 标签中给出了背景图像 URl...但它不起作用...为什么呢?
谢谢
Am working on an android application using cordova and jquery mobile. How to set a background image in this application?i need to put a backgroung image in all pages...
This is my code..See i have only one html page and the below code comes in that html page..also it represents a page..i have 6 pages like this in a single html page..i want to put a background image in these 6 pages.
<div data-role="page" id="home_page" data-content-theme="a" style="background-image:url(images/back.jpg)" >
<div data-role="header">
<div data-role="navbar">
<ul>
<li><a href="#about_us_page" id="products" data-transition="none">About</a></li>
<li><a href="#purpose_page" id="projects" data-transition="none">Purpose</a></li>
<li><a href="#design_page" id="awards" data-transition="none">Design</a></li>
</ul>
</div>
Exit
<p align="justify">content content.....</p>
<div data-role="footer" style="position:absolute;bottom:0px;" class="footer">
<div data-role="navbar">
<ul>
<li><a href="#construction_page" id="about_us" data-transition="none">Construction</a></li>
<li><a href="#issues_page" id="contacts" data-transition="none">Issues</a></li>
<li><a href="#share_page" id="locations" data-transition="none">Share</a></li>
</ul>
</div>
</div>
Here i have given the backgroung image URl in the opening div tag...but it is not working..why is that?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将此 CSS 放在每个页面的顶部:
您还可以将 CSS 规则放入外部文件中并将其链接到每个页面上,如下所示:
Put this CSS at the top of every page:
You could also put the CSS rules into an external file and link it on every page like so:
要在 JQM 中设置背景图像,您需要覆盖 .ui-body-b,其中“b”是您的主题标识符。
To set a background image in JQM you need to override .ui-body-b where 'b' is your theme identifier.