简体   繁体   English

离子转换仅在iOS中获得白页

[英]Ionic transitions getting white page only in ios

Im developing an app in ionic and its working perfectly fine in android, emulators and web (with ionic serve). 我正在开发离子应用程序,并且可以在android,模拟器和网络(使用离子服务)中完美运行。 But when is running in ios devices in transitions between pages suddenly it shows a white view instead the view that it have to display. 但是,当在页面之间的过渡中在ios设备中运行时,它突然显示白色视图,而不是它必须显示的视图。 This doesn't happen all time and i didn't figured out when specifically happen. 这不会一直发生,我也没有弄清楚具体何时发生。

I appreciate any help. 感谢您的帮助。

it is probably a javascript error. 这可能是JavaScript错误。 To find it, the best way is: 要找到它,最好的方法是:

  1. first connect the phone with your mac (must be a mac) by USB. 首先通过USB将手机与Mac(必须为Mac)连接。
  2. Open Safary (no Chrome or Firefox) 打开Safary(无Chrome或Firefox)
  3. In the Safary settings -> Advanced -> enable develop tools 在Safary设置->高级->启用开发工具中 在此处输入图片说明
  4. Now on Safary will appear a develop menu on the top, click on it and you will see your phone and the app running, click on it. 现在,在Safary上将在顶部显示一个开发菜单,单击它,您将看到您的手机和该应用程序正在运行,单击它。 在此处输入图片说明
  5. In the develop tools, will appear all the console you normally see testing with ionic serve, but in the real device. 在开发工具中,将出现您通常会看到的使用离子服务测试的所有控制台,但会出现在实际设备中。
  6. Just use the app and when you get a black page check the javascript error on safary develop tool. 只需使用该应用,当您获得黑页时,请检查safary开发工具中的javascript错误。 在此处输入图片说明

I hope it helps, it did helped me a lot after discover it. 我希望它会有所帮助,发现它后对我有很大帮助。

Finally I resolve it, it was a problem with transitions of ionic in ios. 最后,我解决了它,这是ios中离子过渡的问题。 Adding this line to config in app.js like this 像这样将这行添加到app.js中的配置中

    .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) { 
        $ionicConfigProvider.views.swipeBackEnabled(false);
    }

Disable all back navigations transitions with swipe. 滑动即可禁用所有后退导航过渡。

For what I searched, it can be a lot of things.. What helped me to figure out my case was small commits. 对于我搜索的内容,可能有很多事情。帮助我弄清案件的是小提交。 Anyway, I tried to use default param values and it doesn't work for my webview in iOS. 无论如何,我尝试使用默认的参数值,但它不适用于iOS中的Webview。 If that's your problem too, you can see an alternative way to do default param values here: Set a default parameter value for a JavaScript function 如果这也是您的问题,那么您可以在此处看到另一种执行默认参数值的方法: 为JavaScript函数设置默认参数值

didn't work: 没用:

function(param = defaultValue){}

did work: 做过:

function(param){    
  param = param ? param : defaultValue;
}

只需在您的ion-view元素上使用can-swipe-back="false"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM