该应用程序在浏览器上运行良好,但当我部署在 android 设备或模拟器上时显示空白屏幕。
在 iOS 模拟器上部署会显示银行背景,但在设备上也会显示空白。
我怀疑这是一个路由问题,因为当我将它直接放在 index.html 的主体上时它会显示导航栏
这是 index.html 的片段
angular.module('ilearn.routes', [])
//Configure view routes
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/Common/Menu.html',
controller: 'AppCtrl'
})
.state('app.activity', {
url: '/activity',
views: {
'menuContent': {
templateUrl: 'templates/network/Activity.html'
}
}
})
$urlRouterProvider.otherwise('/app/dashboard');
});
<script>...scripts</script>
</head>
<body ng-app="app">
<ion-nav-view></ion-nav-view>
</body>
menu.html 文件是这样的
<ion-side-menus >
<ion-side-menu-content>
<ion-nav-bar class="bar bar-header bar-balanced">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="right" ng-show="isUserLoggedIn">
<a class="button button-icon button-clear ion-person pull-right" href="#/app/profile">
</a>
<a class="button button-icon button-clear ion-log-out"">
</a>
</ion-nav-buttons>
<ion-nav-buttons side="left">
<a class="button button-icon button-clear ion-navicon" href="#/app/dashboard">
</a>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<!--
<ion-side-menu side="left">
<ion-header-bar class="dark-bg expanded">
<span class="avatar hero" style="background: url('img/iLearn-logo.png'); background-size: cover;"></span>
<h2>iLearn</h2>
</ion-header-bar>
<ion-content class="stable-bg has-expanded-header">
<ion-list>
<ion-item menu-close ng-click="login()">
Login
</ion-item>
<ion-item menu-close href="#/app/login">
Login 1
</ion-item>
<ion-item menu-close href="#/app/dashboard">
Dashboard
</ion-item>
<ion-item menu-close href="#/app/search">
Search
</ion-item>
<ion-item menu-close href="#/app/profile">
Profile
</ion-item>
<ion-item menu-close href="#/app/courses">
Courses
</ion-item>
<ion-item menu-close href="#/app/browse">
Browse
</ion-item>
<ion-item menu-close href="#/app/playlists">
Playlists
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
-->
</ion-side-menus>