【发布时间】:2016-08-05 09:14:15
【问题描述】:
我正在开发一个离子移动应用程序。我想加载一个网站并在完全加载后将其显示在屏幕上。在等待网站加载时,我想要一张背景图片和一个微调器,向用户指示他/她必须等待。 下面是我用来加载网站的代码(在 app.js 文件中)。但是,我不确定该命令应该放在哪里。
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
window.open('https://www.google.com', '_self', 'location=no');
if(window.cordova && window.cordova.plugins.Keyboard) {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
// Don't remove this line unless you know what you are doing. It stops the viewport
// from snapping when text inputs are focused. Ionic handles this internally for
// a much nicer keyboard experience.
cordova.plugins.Keyboard.disableScroll(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
在 index.html 文件中:
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title" aligh=center >Starter</h1>
</ion-header-bar>
<ion-content>
<ion-spinner icon="spiral"></ion-spinner>
</ion-content>
</ion-pane>
我是否需要控制器来完成任务(知道网站何时准备就绪并显示它)?
【问题讨论】:
-
特定于编程和软件开发的问题不在主题范围内,请参阅On-Topic。试试Stack Overflow,但请先阅读How do I ask a good question?。您可以标记您的问题并请版主迁移它。
标签: android javascript css ios