我读过这篇文章:http://scottbolinger.com/4-ways-to-make-your-ionic-app-feel-native/
我正在尝试使用原生过渡运行我的应用程序,但我似乎无法让它们工作。我通过js添加了库:
<script src="cordova.js"></script>
<script src="NativePageTransitions.js"></script>
<script src="js/app.js"></script>
这是我的app.js:
angular.module('starter', [
'ionic-native-transitions'
])
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
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();
}
});
})
如果我通过浏览器运行我的应用程序,则在控制台中出现以下错误: “Cordova未定义”
哪个应该没问题,因为cordova只能通过手机应用程序加载。
我还在我的锚标记中添加了这个属性:
<a class="item item-thumbnail-left" native-transitions href="tipo_credito.html">
<img src="img/credito.jpg">
<h2>Tipo de Credito</h2>
<p>Pantalla de Tipo de Credito</p>
</a>
我需要帮助,我不明白为什么当我通过Android应用程序运行它时仍然无法正常工作。