我有问题的视图,可以通过菜单访问,这是在‘更多’按钮下的选项卡栏。每次我使用例如条形码扫描仪,或相机从通过这个菜单访问的视图拍摄一张照片,我的应用程序冻结。
当使用相同的代码直接从选项卡栏项目访问相同的视图时,我的应用程序不会冻结。
我在用:
为了复制这一问题:
steroids create testapp
cd testapp
steroids update
steroids generate module camera (Select "Javascript" to be generated.)
steroids connect启动一个编辑器并编辑testapp/config/structure.咖啡。在制表符栏的第二个位置插入一个选项卡以访问相机模块,如下所示:
tabs: [
{
title: "Index"
id: "index"
location: "example#getting-started" # Supersonic module#view type navigation
}
{
title: "Camera"
id: "camera"
location: "camera#index"
}
{
title: "Settings"
id: "settings"
location: "example#settings"
}
{
title: "Internet"
id: "internet"
location: "http://google.com" # URLs are supported!
}
]编辑testapp/app/卡梅隆/脚本/IndexController.js,并确保它包含以下代码:
angular
.module('camera')
.controller('IndexController', function ($scope, supersonic) {
$scope.takePicture = function () {
var options = {
quality: 50,
allowEdit: true,
targetWidth: 300,
targetHeight: 300,
encodingType: "png",
saveToPhotoAlbum: true
};
supersonic.media.camera.takePicture(options).then(function (result) {
// Do something with the image URI
});
};
});编辑testapp/app/camera/views/index.html,并确保它包含以下标记:
<div ng-controller="IndexController">
<super-navbar>
<super-navbar-title>
Index
</super-navbar-title>
</super-navbar>
<div class="padding">
<h1>Pow! Here's your fresh module!</h1>
<button class="button button-block button-positive icon-left super-wand" ng-click="takePicture()">Take picture
</button>
</div>
保存所有文件。然后,从testapp文件夹中的终端窗口运行:
steroids connect这应该打开你的浏览器与类固醇连接QR显示。启动设备上的AppGuyver扫描仪。从屏幕上扫描QR代码。这应该会激活你的应用程序。
点击第二个选项卡(没有显示图标,只是文字“相机”,但这并不重要)。它打开了相机模块的视野。点击“拍照”。拍一张照片,确认你想使用这张照片。该应用程序返回到相机模块的视图。现在一切都很好..。所以摄像机正常工作。
现在去你的终端机窗口退出类固醇。在shell中,执行以下命令:
steroids generate test1
steroids generate test2现在,再次更改testapp/config/structure.咖啡文件,并编辑如下所示的选项卡:
tabs: [
{
title: "Index"
id: "index"
location: "example#getting-started" # Supersonic module#view type navigation
}
{
title: "Settings"
id: "settings"
location: "example#settings"
}
{
title: "Internet"
id: "internet"
location: "http://google.com" # URLs are supported!
}
{
title: "Test 1"
id: "test1"
location: "test1#index"
}
{
title: "Test 2"
id: "test2"
location: "test2#index"
}
{
title: "Camera"
id: "camera"
location: "camera#index"
}
]再次保存文件。在终端窗口中键入:
steroids connect再次扫描浏览器中显示的QR代码以运行该应用程序。
使用标签栏,按“更多”按钮(三个点位于最右位置)。打开一个新菜单。现在点击一个‘相机’菜单项。这将激发相机模块的视图。点击“拍照”。拍一张照片,确认你想使用这张照片。
该应用程序现在挂起。当你取消拍照时,也会发生同样的情况。
我还在iPhone 5s,iPad 2(添加额外的选项卡项时)上复制了这个选项卡。日志显示了最后一行的内容:
camera#index 10:33:53.534 debug "supersonic.media.camera.takePicture called"
camera#index 10:33:48.514 debug "supersonic.ui.navigationBar.setStyleId resolved"
camera#index 10:33:48.490 debug "supersonic.ui.navigationBar.setStyle resolved"
camera#index 10:33:48.453 debug "supersonic.ui.navigationBar.update called"
camera#index 10:33:48.438 debug "supersonic.ui.navigationBar.setStyle called"
camera#index 10:33:48.472 debug "supersonic.ui.navigationBar.setClass resolved"
camera#index 10:33:48.554 debug "supersonic.ui.navigationBar.show resolved"
camera#index 10:33:48.465 debug "supersonic.ui.navigationBar.show called"
camera#index 10:33:48.552 debug "supersonic.ui.navigationBar.update resolved"
camera#index 10:33:48.449 debug "supersonic.ui.navigationBar.setStyleId called"
camera#index 10:33:48.390 debug "supersonic.ui.navigationBar.setClass called"你知道这里有什么问题吗?
致以亲切的问候,
埃里克
发布于 2015-03-06 08:58:56
这里的AppGyver开发人员--听起来像是一个可能的本地错误。过去,通过“更多”按钮访问选项卡时,我们会遇到更严重的问题,请参阅这里,因此这可能来自于同一件事。
你能发布一个问题到我们的问题跟踪在https://github.com/AppGyver/steroids/issues -最好是一个云部署的应用程序,以复制这一点?
https://stackoverflow.com/questions/28877851
复制相似问题