我使用Sencha Touch 2开发了一款移动应用,但我遇到了这个问题: 我可以通过将应用程序上传到服务器(或在wamp,node等本地)以及使用
时看到该应用程序 1 - 桌面上的镀铬,
2 - 用于android的chrome,或者
3 - 三星Galaxy S或HTC One或任何Android手机的Android浏览器
4 - 在任何iphone浏览器或原生webview中,该应用程序也可以使用
但是当我尝试使用Android中的webview(本机APK)访问相同的URL时,它不会隐藏启动画面。 当从浏览器访问时,启动屏幕停留一两秒然后消失,并显示应用程序内的第一个屏幕,因此我确信在“webview版本”中它被卡住了。
重要提醒:
1 - 尝试使用autoMaximize:true和false - 不工作无关紧要
2 - 我试图访问的版本是使用“sencha app build production”(PRODUCTION BUILD)构建的。所有其他版本都可以在任何地方访问并且功能齐全(测试构建,包构建等)。令我头疼的唯一版本是生产版本(但我必须使用此版本进行生产,我不能给客户端提供测试版本。)
这是我的app.js
Ext.application({
name: 'AR',
viewport: {
autoMaximize: true//( navigator.userAgent.search("Safari") != -1 && (!Ext.browser.is.Standalone && Ext.os.is.iOS && Ext.browser.version.isGreaterThan(3) ) ? true : false )
},
requires: [
'Ext.MessageBox',
'Ext.data.proxy.JsonP',
'Ext.data.JsonP',
'Ext.Ajax',
'Ext.plugin.ListPaging',
'Ext.*'
],
views: ['Main','Loading','About','ItemDetail','ListByCategory','ListByGenres','HeaderPanel','Search','ItemsLoad','ScreensContainer','DataList','SearchResultsList','SearchResultBar','SearchPanel','SearchResults','BackBtn','HebrewList','CategoriesPanelContainer'],
models: ['Category','Genre','Category','ItemsLoad','CategoriesPanel','ItemLoad','ResultsBar','HomePageContentLoad'],
stores: ['Categories','Genres','Categories','ItemsLoad','CategoriesPanel','ItemLoad','FreeTextItemsLoad','ResultsBar','HomePageContentLoad'],
controllers: ['ListController','MenuController','AppController','SearchController','ItemController'],
icon: {
'57': 'resources/icons/Icon.png',
'72': 'resources/icons/Icon~ipad.png',
'114': 'resources/icons/Icon@2x.png',
'144': 'resources/icons/Icon~ipad@2x.png'
},
isIconPrecomposed: true,
startupImage: {
'320x460': 'resources/startup/320x460.jpg',
'640x920': 'resources/startup/640x920.png',
'768x1004': 'resources/startup/768x1004.png',
'748x1024': 'resources/startup/748x1024.png',
'1536x2008': 'resources/startup/1536x2008.png',
'1496x2048': 'resources/startup/1496x2048.png'
},
launch: function() {
// Destroy the splashscreen element
Ext.fly('splashScreenClass').destroy();
Ext.Viewport.add(Ext.create('AR.view.Main'));
},
// onUpdated: function() {
// Ext.Msg.confirm(
// "Application Update",
// "This application has just successfully been updated to the latest version. Reload now?",
// function(buttonId) {
// if (buttonId === 'yes') {
// window.location.reload();
// }
// }
// );
// },
iconsDictionary: {
'הכל' : 'everythingLogoClass',
'כלים' : 'toolsLogoClass',
'מאמרים' : 'docsLogoClass',
'סרטונים' : 'videosLogoClass',
'סיפורי מקרה' : 'storiesLogoClass'
}
});
这是index.html
<!DOCTYPE html>
<html manifest="" lang="en-US">
<head>
<!-- <meta name="viewport" content="width=device-width, target-densityDpi=device-dpi"> -->
<meta charset="UTF-8">
<title>AR</title>
<style type="text/css">
html, body {
height: 100%;
/*background-color: #1985D0*/
}
.splashScreenLogo
{
background: url('resources/images/splashLogo.png') no-repeat;
height: 136px;
width: 204px;
text-align: center;
position: relative;
top: 20%;
padding-bottom: 15px;
}
#splashScreenClass
{
text-align: center;
height: 100%;
width: 100%;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 1%, #e5f6f9 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ffffff), color-stop(100%,#e5f6f9)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 1%,#e5f6f9 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 1%,#e5f6f9 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 1%,#e5f6f9 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 1%,#e5f6f9 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5f6f9',GradientType=0 ); /* IE6-9 */
}
.splashScreenText
{
font-family: 'Eleganti';
width: 100%;
text-align: center;
height: 55px;
color:white;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #0155a4 51%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(51%,#0155a4), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#0155a4 51%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#0155a4 51%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#0155a4 51%,#ffffff 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#0155a4 51%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}
</style>
</head>
<body>
<div id="splashScreenClass">
<div style="height:20%;width:100%;"></div>
<center><div class="splashScreenLogo"></div></center>
<div style="height:5%;width:100%;"></div>
<div class="splashScreenText"><p style="top: 13px;font-size: 30px;position: relative;">מרכז הידע</p></div>
<!-- <img src='resources/images/splash.jpg' /> -->
</div>
<!-- The line below must be kept intact for Sencha Command to build your application -->
<script id="microloader" type="text/javascript" src="sdk/microloader/development.js"></script>
<!--<script src="js/appservice.js"></script>-->
</body>
</html>
如果有人知道发生了什么,我真的很感激一些帮助。 谢谢,