- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在尝试使用 ion-nav-view 时遇到问题。当我尝试使用它时,它在模拟器中显示黑屏,但在 ionic 服务中,它非常适合我。
我认为这是一个语法错误。
此外,当我创建一个空白元素时,它在模拟器中完美运行。
我的元素(不工作)
空白元素(有效)
Index.html
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="cordova.js"></script>
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="starter" animation="slide-left-right-ios7">
<ion-nav-bar></ion-nav-bar>
<ion-nav-view></ion-nav-view>
</body>
</html>
/templates/apps/index.html
<ion-view title="Hello World">
<ion-content>
<h2>Hello World</h2>
</ion-content>
</ion-view>
应用程序.js
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
// Ionic uses AngularUI Router which uses the concept of states
// Learn more here: https://github.com/angular-ui/ui-router
// Set up the various states which the app can be in.
// Each state's controller can be found in controllers.js
$stateProvider
// setup an abstract state for the tabs directive
.state('apps', {
url: '/',
templateUrl: '/templates/apps/index.html'
});
// if none of the above states are matched, use this as the fallbac
$urlRouterProvider.otherwise('/');
});
最佳答案
尝试使您的 templateUrl: 'templates/apps/index.html'
。正斜杠使路径成为绝对路径,这将适用于 ionic serve
,因为它是在域的根目录下运行的 Web 服务器。它在应用程序中不起作用,因为文件是通过 file://协议(protocol)加载的并且不在根目录下,因此它可能会崩溃,因为您引用的文件不存在并且可能在应用程序之外,因此可能权限问题。
关于javascript - Ionic - ion-nav-view 在模拟器中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26634270/
ionic 4: 我在标签中有一张图片和一个标签,我希望它们并排出现在中央。 HTML:
使用 ionic v3 开发混合应用程序,我在使用 *ngFor 生成的 ionic 列表中有 ionic 项。问题出在 iOS 设备上,即我无法滚动在 y 方向溢出的 ionic 列表。但是安卓设备
我遇到了 ion-item 背景颜色的问题。 我想要什么: 将背景颜色设置为透明。 我有什么: Remember me! 这会生成一个 背景为白色。 我尝试做的事情: 应用程序组
我正在尝试通过 JS 为我的 ionic 输入元素分配一个值。这是我的代码: HTML: JavaScript: function onSuccess(position) { var
完成一些教程后,我开始使用我自己的 Ionic 应用程序。我开始使用 ionic 的空白模板。我的问题是我的 ion-view(在 cards.js 中,见下文)根本没有出现在 ion-nav-vie
我正在开发一个应用程序,我正在从 JSON 获取数据并且它运行良好,但我的问题是我不知道如何使用指令使用 CSS 样式。下面我展示了代码。第二段代码是css起作用的代码。
我正在使用具有动态值的 ion-radio ,并且需要将第一个值设置为使用 react 形式选择的值。 Type
Atualizado em: {{ultimaAtualizacao | date:'dd/MM/yyyy'}} 我想改变 ion-title 的文字大小,我已经尝试过使用 css,但它没有
我的 ion-content 中有两个输入字段,它们都附加了一个 ng-model。然后在我的 ion-footer 中有一个 ng-click,我在其中调用一个函数并传入两个 ng-models。
我正在基于 ionic 框架构建 phonegap 应用程序。在一个 html 页面中,我需要一个标题和一个内容。但是标题与内容重叠。抱歉,我没有足够的声誉来发布图像。 代码如下。 html 页面与
我尝试了多种方法: 设置内联样式,但看起来 @ionic 在生成 toast 时删除了 style="...." 属性 CSS 变量,但不知道如何设置不公开 api( ionic 图标)的嵌套阴影元素
我目前正在开发 Ionic 应用程序并坚持在 ion-header 和 ion-content 中实现图像。 这是我如何实现的屏幕截图。 从截图中可以看出, ionic 标题和 ion-content
我是ionic的新手,我想上传图片,因此我使用“ng-file-upload”上传我的图片。 但代码仅在我删除“ ion-content ”时才起作用。我的模板是:
我想删除调用 ion-select 时生成的 ion-radio(带有弹出界面) Popover Brown Blonde Black
我想删除调用 ion-select 时生成的 ion-radio(带有弹出界面) Popover Brown Blonde Black
我的 View 如下图所示: 我希望视频容器不可滚动(静态),但视频容器下的列表应该是可滚动的。 请问我如何在 Ionic 框架中做到这一点? 我尝试将绝对位置设置为视频容器并将列表放在容器上方。但如
我确定可能有一种方法可以全面覆盖字体颜色,但我不确定语法 - 我想它在 scss 文件中很容易实现 - 有什么想法吗? 最佳答案 在CSS中使用它 *{ color:#123456; } 将C
我想在更改 ionic 选项时传递员工 ID。我试过这个,但它不起作用,如果有任何错误,请告诉我 这是我的代码: Employee {{ employee.FirstName + " " +
到目前为止,我有一个非常简单的应用程序,但我不知道如何修复内容的重叠(内容顶部的标题)。我创建了一个组件 header顾名思义,它包含标题。 header.html
如标题所述,我正在尝试从 $http 请求分配一个列表,然后在 View 中查看该列表。 我认为问题是 View 在数据加载之前显示,如果我理解正确的话。当变量改变时, View 永远不会更新。 有人
我是一名优秀的程序员,十分优秀!