Ylbtech-ionic-javascript:ionic Pull-up menu (Actionsheet) |
1. Ionic Pull-up menu (Actionsheet)
The Pull-up menu (Actionsheet) lets the user select an option by going up the box that pops up.
Very dangerous options are highlighted in red to let people recognize the first time. You can make it disappear by clicking on the Cancel button or by clicking on the blank area.
Instance HTML code
<body Ng-app="starter" ng-controller="Actionsheetctl" > < ion-pane> <ion-content > ng-click="show ()" >Action Sheet </ion-content> </ion-pane></body >
JavaScript Code
Triggering the pull-down menu in your code requires the $ionicActionSheet service to be used in your angular controller:
Angular.Module(' Starter ', [' Ionic ']).Run(function($ionicPlatform) {$ionicPlatform.Ready(function() { Hide the Accessory Bar by default (remove this to show the accessory bar above the keyboard for form inputs) If(Window.Cordova&&Window.Cordova.Plugins.Keyboard) {Cordova.Plugins.Keyboard.Hidekeyboardaccessorybar(True); } If(Window.StatusBar) { StatusBar.Styledefault(); } });}).Controller( ' Actionsheetctl ',[' $scope ',' $ionicActionSheet ',' $timeout ' ,function($scope,$ionicActionSheet,$timeout){$scope.Show= function() { VarHidesheet=$ionicActionSheet.Show({Buttons: [ {Text: ' <b>Share</b> this ' }, {Text: ' Move ' } ],Destructivetext: ' Delete ',TitleText: ' Modify your album ',Canceltext: ' Cancel ',Cancel: function() { Add Cancel Code: }, Buttonclicked: function (index) {return true; } }); $timeout (function () Span class= "pun" >{ Hidesheet (); }, 2000); }; }]) /span>
Try it?
Operating effects such as:
2.
1, HTTP://WWW.RUNOOB.COM/IONIC/IONIC-ACTIONSHEET.HTML2,
|
Ylbtech Source: http://ylbtech.cnblogs.com/ This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility. |
Ionic-javascript:ionic Pull-up menu (Actionsheet)