android - 在某些手机中以整页显示的 Jquery 移动应用程序标题

标签 android jquery html css jquery-mobile

我使用 Jquery Mobile 开发了一个 Android 应用程序。它包含一个标题,其中有一个背景图像。在某些手机中,该应用程序运行完美。但在某些手机中,只有包含背景图像的标题会显示在整个屏幕中,没有任何反应。它不显示页面的其余内容。这是页面的代码:-

<!DOCTYPE HTML>
<html>
<head>
<title>Demo</title> 
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />    




<link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" />



<script src="js/jquery.min.js"></script>
<script src="js/jquery.mobile-1.4.5.min.js"></script>
<script type='application/javascript' src='js/fastclick.js'></script>



</head>
<body >

<div data-role="page" class="content" data-theme='b'>

<div  data-role="header" data-position="fixed" data-tap-toggle="false" data-theme='b'>
<div class="ui-grid-solo">
<div class="ui-block-a"><div class="logodiv"><img height="100%" width="100%" src="img/logo2.png" /></div> 
</div>
</div>
</div>
Some Content here
Some Content here
Some Content here
</div>
</body>
</html>

CSS 如下:-

.ui-page
{
    background-color: #EBEAF2;
}
.ui-header
{
    background-color: #EBEAF2!important;    
}
body 
{
    cursor:pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: moz-none;
    -ms-user-select: none;
    user-select: none;
}
.content 
{
    background-image: url(img/bg.png);
    background-size:cover;
    background-repeat: no-repeat;
    background-size: 300px 300px;
    background-position: center; 
    }
body
{
  background-image: img/bcklogo.png;
}

  body ,h1 , h2 ,h3,h4,h5,h6
{
  font-family: 'Roboto',serif;
}

最佳答案

您已跳过写入数据 Angular 色内容,并且一个 div 未正确关闭。

Also in class logodiv you need to provide header height.

Please check this code below

<!DOCTYPE HTML>
<html>
<head>
<title>Demo</title> 
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />    




<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />



<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

<style> 

.ui-page
{
    background-color: #EBEAF2;
}
.ui-header
{
    background-color: #EBEAF2!important;    
}
body 
{
    cursor:pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: moz-none;
    -ms-user-select: none;
    user-select: none;
}
.content 
{
    background-image: url(img/img.png);
    background-size:cover;
    background-repeat: no-repeat;
    background-size: 300px 300px;
    background-position: center; 
    }
body
{
  background-image: img/img.png;
}

  body ,h1 , h2 ,h3,h4,h5,h6
{
  font-family: 'Roboto',serif;
}

.logodiv {
height: 80px;
}
</style>


</head>
<body>

<div data-role="page" class="content" data-theme='b'>

<div  data-role="header" data-position="fixed" data-tap-toggle="false" data-theme='b'>
<div class="ui-grid-solo">
<div class="ui-block-a"><div class="logodiv"><img height="100%" width="100%" src="img/img.png" /></div> 
</div>
</div>
</div>
<div data-role="content">
Some Content here
Some Content here
Some Content here
</div>
</div>
</body>
</html>

关于android - 在某些手机中以整页显示的 Jquery 移动应用程序标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31318826/

相关文章:

strings.h 中的 Android NDK 错误,可能是由于 size_t 错误

javascript - 找到html元素的底部位置并将内部元素放在父元素的底部

javascript - 在 .erb 文件中内联 <% f.submit %> 样式

html - 如何使选项卡就像 stackoverflow 中的一样

jquery - 在 html 页面中,文件 uploader 只接受 png

android - 在 Android 中上传视频

Android asynctask自定义适配器在错误位置加载图像

java - 如何使应用程序与 Asterisk 服务器进行交互以进行调用?

javascript - 如何在 CSS 中为浏览按钮指定样式(图像)?

javascript - 旋转 90/-90 度的图像模糊 jquery 旋转