$ ionicSlideBoxDelegate.enableSlide(false)无法在IOS上运行

时间:2017-03-29 03:58:21

标签: ios angularjs ionic-framework

我有一个幻灯片盒,在我的控制器中我放置了这个以防止幻灯片盒标签左右滑动:

  $timeout(function() {
    return $ionicSlideBoxDelegate.enableSlide(false);
  }, 1);

适用于Android,但不适用于IOS。有什么建议?

1 个答案:

答案 0 :(得分:0)

我使用这个滑动控制器左右图像。

$ionicModal.fromTemplateUrl('image-modal.html', {
    scope: $scope,
    animation: 'slide-in-up'
  }).then(function(modal) {
    $scope.modal = modal;
  });

  $scope.openModal = function(galryPubId) {
    $ionicSlideBoxDelegate.slide(galryPubId);
    $scope.modal.show();
  };

  $scope.closeModal = function() {
    $scope.modal.hide();
  };

  // Cleanup the modal when we're done with it!
  $scope.$on('$destroy', function() {
    $scope.modal.remove();
  });
  // Execute action on hide modal
  $scope.$on('modal.hide', function() {
    // Execute action
  });
  // Execute action on remove modal
  $scope.$on('modal.removed', function() {
    // Execute action
  });
  $scope.$on('modal.shown', function() {
    console.log('Modal is shown!');
  });

  // Call this functions if you need to manually control the slides
  $scope.next = function() {
    $ionicSlideBoxDelegate.next();
  };

  $scope.previous = function() {
    $ionicSlideBoxDelegate.previous();
  };

  $scope.goToSlide = function(index) {
    $scope.modal.show();
    $ionicSlideBoxDelegate.slide(index);
  }

  // Called each time the slide changes
  $scope.slideChanged = function(index) {
    $scope.slideIndex = index;
  };

它适用于平台Android / iOS。