Ionic 常见疑难杂症

来源:互联网 发布:淘宝刷手p图软件哪个好 编辑:程序博客网 时间:2024/06/06 10:55

图片轮播

电脑上显示不出来

setTimeout(function() {    $ionicSlideBoxDelegate.slide(0);    $ionicSlideBoxDelegate.update();    $scope.$apply();    });

获取轮播图片数量,和第几张图片

$scope.slideChange = function (){        //图片总数量        $scope.slideCount = parseInt($ionicSlideBoxDelegate.slidesCount());        //当前第几张        $scope.slideCurrentIndex = parseInt($ionicSlideBoxDelegate.currentIndex()) + 1;    }

设置弹框样式

 /*弹框样式*/  .popup-head {     border-bottom: none;  }  .popup-container .popup {    border-radius: 1rem;    background-color: rgba(255,255,255,1);  }  .popup-body{    padding: 10px;    overflow: auto;    text-align: center;    border-bottom: 1px solid #E5E5E5;  }  .popup-body a{    font-size: 1.5rem;    color: black;  }  .popup-buttons button:nth-child(2){    border-left: 1px solid #E5E5E5;  }  .button, .button.button-positive{    background-color: white;    color: blue;  }

隐藏滚动条

 .scroll-bar-indicator  {    display: none;  }

滑动删除后,隐藏删除

//ios上有用,安卓好像不行$ionicListDelegate.closeOptionButtons();//启用js滚动,android上可以$ionicConfigProvider.scrolling.jsScrolling(true);

获取ui-router的一个stateName

 //监听state跳转,获取上一个的stateName    $rootScope.$on('$stateChangeSuccess', function(event, to, toParams, from, fromParams) {      $rootScope.$previousState = from;    });

ui_router声明路由的resolve属行中不能用$scope,否则会造成循环依赖

0 0