首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AppGuyver类固醇/超音速应用程序在使用“更多”选项卡下由选项卡打开的摄像机时冻结。

AppGuyver类固醇/超音速应用程序在使用“更多”选项卡下由选项卡打开的摄像机时冻结。
EN

Stack Overflow用户
提问于 2015-03-05 12:25:53
回答 1查看 305关注 0票数 1

我有问题的视图,可以通过菜单访问,这是在‘更多’按钮下的选项卡栏。每次我使用例如条形码扫描仪,或相机从通过这个菜单访问的视图拍摄一张照片,我的应用程序冻结。

当使用相同的代码直接从选项卡栏项目访问相同的视图时,我的应用程序不会冻结。

我在用:

  • 节点v0.10.36
  • 类固醇v4.0.12
  • AppGuyver扫描仪4.0.3
  • iPhone 4w/iOS 7.1.2

为了复制这一问题:

代码语言:javascript
复制
steroids create testapp
cd testapp
steroids update
steroids generate module camera (Select "Javascript" to be generated.)
steroids connect

启动一个编辑器并编辑testapp/config/structure.咖啡。在制表符栏的第二个位置插入一个选项卡以访问相机模块,如下所示:

代码语言:javascript
复制
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,并确保它包含以下代码:

代码语言:javascript
复制
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,并确保它包含以下标记:

代码语言:javascript
复制
<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文件夹中的终端窗口运行:

代码语言:javascript
复制
steroids connect

这应该打开你的浏览器与类固醇连接QR显示。启动设备上的AppGuyver扫描仪。从屏幕上扫描QR代码。这应该会激活你的应用程序。

点击第二个选项卡(没有显示图标,只是文字“相机”,但这并不重要)。它打开了相机模块的视野。点击“拍照”。拍一张照片,确认你想使用这张照片。该应用程序返回到相机模块的视图。现在一切都很好..。所以摄像机正常工作。

现在去你的终端机窗口退出类固醇。在shell中,执行以下命令:

代码语言:javascript
复制
steroids generate test1
steroids generate test2

现在,再次更改testapp/config/structure.咖啡文件,并编辑如下所示的选项卡:

代码语言:javascript
复制
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"
}
]

再次保存文件。在终端窗口中键入:

代码语言:javascript
复制
steroids connect

再次扫描浏览器中显示的QR代码以运行该应用程序。

使用标签栏,按“更多”按钮(三个点位于最右位置)。打开一个新菜单。现在点击一个‘相机’菜单项。这将激发相机模块的视图。点击“拍照”。拍一张照片,确认你想使用这张照片。

该应用程序现在挂起。当你取消拍照时,也会发生同样的情况。

我还在iPhone 5s,iPad 2(添加额外的选项卡项时)上复制了这个选项卡。日志显示了最后一行的内容:

代码语言:javascript
复制
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"

你知道这里有什么问题吗?

致以亲切的问候,

埃里克

EN

回答 1

Stack Overflow用户

发布于 2015-03-06 08:58:56

这里的AppGyver开发人员--听起来像是一个可能的本地错误。过去,通过“更多”按钮访问选项卡时,我们会遇到更严重的问题,请参阅这里,因此这可能来自于同一件事。

你能发布一个问题到我们的问题跟踪在https://github.com/AppGyver/steroids/issues -最好是一个云部署的应用程序,以复制这一点?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28877851

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档