我在运行Android 5.0.2版的HTC One M8上测试我的应用程序.当应用程序中的输入字段失去焦点时,键盘关闭后会显示白色背景.

我的背景图片已打开.scroll-content,因此我不明白为什么它在Android上的行为如此.
我已经设置了模板页面和路线.当我将状态更改为"登录"状态时,我的页面转换不起作用,它只显示没有转换的页面.我不知道问题是什么.我的应用程序的主页是带有<ion-nav-view>元素的index.html .
这是我的路由代码:
config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('app.home', {
url: '/home',
views: {
'menuContent': {
templateUrl: "templates/home.html",
controller: 'HomeCtrl'
}
}
})
.state('login', {
url: "/login",
templateUrl: "templates/login.html",
controller: 'LoginCtrl'
});
$urlRouterProvider.otherwise('/app/home');
})
Run Code Online (Sandbox Code Playgroud)
menu.html:此页面是父状态.其他页面继承自它.
<ion-pane ion-side-menu-content>
<ion-nav-bar class="bar-stable" id="header" animation="slide-left-right">
<ion-nav-back-button class="button-clear"><i class="icon ion-ios7-arrow-back"></i> Back</ion-nav-back-button>
<img src="img/logo.png" alt="EasySpree" />
<ion-nav-buttons side="right">
<button class="button button-icon icon ion-ios7-email">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-pane>
Run Code Online (Sandbox Code Playgroud)
index.html:主页面 - 此页面上定义的路由
<ion-nav-view id="main" …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ngCordova模块中定义的$ cordovaContacts服务.我试图在服务中获取手机联系人,以便我可以跨控制器使用它.
Service.js
angular.module("services", ['ngCordova'])
.factory("ContactManager", function($cordovaContacts) {
var contacts; //variable that holds contacts, returned from getContacts
return {
getContacts: function() {
var options = {};
options.filter = "";
options.multiple = true;
//get the phone contacts
$cordovaContacts.find(options).then(function(result) {
contacts = result;
}, function(err) {
});
return contacts;
}
}
});
Run Code Online (Sandbox Code Playgroud)
Controller.js
angular.module("controllers", ['services'])
.controller("ContactCtrl", function(ContactManager) {
$scope.contacts = ContactManager.getContacts(); //this doesn't get set
});
Run Code Online (Sandbox Code Playgroud)
问题是'$ scope.contacts'没有在控制器内设置.但是,当直接将服务代码放在控制器内而不使用服务时,代码可以正常工作.我一直试图找出问题所在.请帮忙!