囚徒 发表于 2015-10-8 12:14:57

如何解决ios9下TAB 切换时会跳动问题?

TAB切换时,会看到TAB会往下跳一下。

qsuron 发表于 2015-10-10 15:36:30

引入这个补丁,然后按照头注释修改APP.js、

/**
*
* https://gist.github.com/IgorMinar/863acd413e3925bf282c
*
*
*
* ==================angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
* dependency on the "ngIOS9UIWebViewPatch" module to your main app module.
*
* For example:
*
* ```
* angular.module('myApp', ['ngRoute'])`
* ```
*
* becomes
*
* ```
* angular.module('myApp', ['ngRoute', 'ngIOS9UIWebViewPatch'])
* ```
*
*
* More info:
* - https://openradar.appspot.com/22186109
* - https://github.com/angular/angular.js/issues/12241
* - https://github.com/driftyco/ionic/issues/4082
*
*
* @license AngularJS
* (c) 2010-2015 Google, Inc. http://angularjs.org
* License: MIT
*/

angular.module('ngIOS9UIWebViewPatch', ['ng']).config(['$provide', function($provide) {
    'use strict';

    $provide.decorator('$browser', ['$delegate', '$window', function($delegate, $window) {

      if (isIOS9UIWebView($window.navigator.userAgent)) {
            return applyIOS9Shim($delegate);
      }

      return $delegate;

      function isIOS9UIWebView(userAgent) {
            return /(iPhone|iPad|iPod).* OS 9_\d/.test(userAgent) && !/Version\/9\./.test(userAgent);
      }

      function applyIOS9Shim(browser) {
            var pendingLocationUrl = null;
            var originalUrlFn= browser.url;

            browser.url = function() {
                if (arguments.length) {
                  pendingLocationUrl = arguments;
                  return originalUrlFn.apply(browser, arguments);
                }

                return pendingLocationUrl || originalUrlFn.apply(browser, arguments);
            };

            window.addEventListener('popstate', clearPendingLocationUrl, false);
            window.addEventListener('hashchange', clearPendingLocationUrl, false);

            function clearPendingLocationUrl() {
                pendingLocationUrl = null;
            }

            return browser;
      }
    }]);
}]);

OnePiece_xiaoJ 发表于 2015-10-8 14:59:17

同问。不知兄弟解决了没?

囚徒 发表于 2015-10-8 15:09:36

OnePiece_xiaoJ 发表于 2015-10-8 14:59
同问。不知兄弟解决了没?

没有啊!就是在找解决方法。

囚徒 发表于 2015-10-10 18:34:27

qsuron 发表于 2015-10-10 15:36
引入这个补丁,然后按照头注释修改APP.js、

完美解决!感谢大神{:2_27:}

Holy_Cc 发表于 2015-11-4 18:03:57

感谢啊,总算不会乱跳了

admin 发表于 2015-11-4 23:09:45

http://www.phonegap100.com/article-448-1.html 这个看看

hmm 发表于 2018-5-28 19:14:05

qsuron 发表于 2015-10-10 15:36
**** 作者被禁止或删除 内容自动屏蔽 ****

大神,我这边ionic1.3 在ios下当输入框聚焦时页面会跳动一下,用这个不行也
页: [1]
查看完整版本: 如何解决ios9下TAB 切换时会跳动问题?