2016-11-26 5 views
1

사이의 갈등을 해결하는 방법, 나는 하나 개의 요소에 on-hold()ion-option-button을 사용했다.내 현재 이온 앱에서 이온 보류 및 이온 옵션 버튼

이제 안드로이드 기기 (cli : ionic run android)에서 앱을 실행할 때 ion-option-button이 제대로 작동하지 않아서 서로 충돌하는 것 같아서 (때때로 ion-option-button 일을하고 때로는하지 않았습니다. 작업)을 제거 할 때 ion-option-button이 제대로 작동하고 부드럽게 작동하기 때문에

제안 사항이 있으십니까?

답변

1

전혀 문제가 해결되지 않았습니다. 때로는 잘못되었지만, 이전보다 훨씬 만족 스럽습니다.

app.directive("myOnHold", ['$ionicGesture', function ($ionicGesture) { 
    return { 
     restrict: "A", 
     link: function ($scope, $element, $attr) { 
      var handleDrag = function (e) { 
       e.preventDefault() 
      }; 

      var dragGesture = $ionicGesture.on('hold', handleDrag, $element); 

      $scope.$on('$destroy', function() { 
       // Unbind drag gesture handler 
       $ionicGesture.off(dragGesture, 'drag', handleDrag); 
      }); 
     } 
    } 
    }])