1, the use of ion-slide can achieve picture carousel, but if in the HTML only add Ion-slide is not enough, there will be two problems:
(Note: Angularjs is used.) First need to inject in, JS file: $ionicSlideBoxDelegate)
One, sometimes the picture can not be loaded out. The solution is:
Add $ionicSlideBoxDelegate to the corresponding controller file. Update ();
Second, the issue of Carousel to the last non-rotation, the solution is:
Add $ionicSlideBoxDelegate. Loop (True) in the corresponding controller file;
The code is as follows:
1 function Getmessageinface () {2 vm.condition = {//Enter parameter 3 "Sysid":4 }; 6 Service. Post (' advertisement ', ' Findeffectivedatainfo ', vm.condition). Then (function(data) {7 Console.log (data) 9 VM. adlists = data;10 Angular.foreach (VM. Adlists, Function(index) {one//STATEMENTS12//Console.log ("Loop increase Imgurl"), if (Index.pic.indexOf ("http") < 0< c15>) {index.pic = Vm.imgurl + });
The injection method is as follows:
(function () {
Angular.module (' app '). Controller (' Goodslistctrl ', Goodslistctrl);
Goodslistctrl. $inject = [' $scope ', ' $state ', ' Service ', ' $stateParams ', ' $localStorage ', ' $ionicSlideBoxDelegate ', ' $ Ionicpopup '];
function Goodslistctrl ($scope, $state, Service, $stateParams, $localStorage, $ionicSlideBoxDelegate, $ionicPopup) {
var vm = this;
......
......
}
})();
Third, the use of $ionicslideboxdelegate.loop (true) there will be a problem that has not been thought to understand: loading two pictures will show four, that is, the two will be repeated, the other conditions are normal. So my final solution is to implement manual carousel based on official documentation ...
Ionic Picture Carousel Problem