{"id":735,"date":"2018-02-25T20:33:15","date_gmt":"2018-02-25T12:33:15","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/25\/ionic-%e4%b8%8a%e6%8b%89%e8%8f%9c%e5%8d%95actionsheet\/"},"modified":"2018-02-25T20:33:15","modified_gmt":"2018-02-25T12:33:15","slug":"ionic-%e4%b8%8a%e6%8b%89%e8%8f%9c%e5%8d%95actionsheet","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=735","title":{"rendered":"ionic \u4e0a\u62c9\u83dc\u5355(ActionSheet)"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h1>ionic \u4e0a\u62c9\u83dc\u5355(ActionSheet)<\/h1>\n<p>\u4e0a\u62c9\u83dc\u5355(ActionSheet)\u901a\u8fc7\u5f80\u4e0a\u5f39\u51fa\u7684\u6846\uff0c\u6765\u8ba9\u7528\u6237\u9009\u62e9\u9009\u9879\u3002<\/p>\n<p>\u975e\u5e38\u5371\u9669\u7684\u9009\u9879\u4f1a\u4ee5\u9ad8\u4eae\u7684\u7ea2\u8272\u6765\u8ba9\u4eba\u7b2c\u4e00\u65f6\u95f4\u8bc6\u522b\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u53d6\u6d88\u6309\u94ae\u6216\u8005\u70b9\u51fb\u7a7a\u767d\u7684\u5730\u65b9\u6765\u8ba9\u5b83\u6d88\u5931\u3002<\/p>\n<hr>\n<h2>\u5b9e\u4f8b<\/h2>\n<h3>HTML \u4ee3\u7801<\/h3>\n<pre>\n&lt;body ng-app=\"starter\" ng-controller=\"actionsheetCtl\" &gt;\n\n    &lt;ion-pane&gt;\n        &lt;ion-content &gt;\n            &lt;h2 ng-click=\"show()\"&gt;Action Sheet&lt;\/h2&gt;\n        &lt;\/ion-content&gt;\n    &lt;\/ion-pane&gt;\n&lt;\/body&gt;\n<\/pre>\n<h3>JavaScript \u4ee3\u7801<\/h3>\n<p>\u5728\u4ee3\u7801\u4e2d\u89e6\u53d1\u4e0a\u62c9\u83dc\u5355\uff0c\u9700\u8981\u5728\u4f60\u7684 angular \u63a7\u5236\u5668\u4e2d\u4f7f\u7528 $ionicActionSheet \u670d\u52a1\uff1a<\/p>\n<pre>\nangular.module('starter', ['ionic'])\n\n.run(function($ionicPlatform) {\n  $ionicPlatform.ready(function() {\n    \/\/ Hide the accessory bar by default (remove this to show the accessory bar above the keyboard\n    \/\/ for form inputs)\n    if(window.cordova &amp;&amp; window.cordova.plugins.Keyboard) {\n      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);\n    }\n    if(window.StatusBar) {\n      StatusBar.styleDefault();\n    }\n  });\n})\n\n.controller( 'actionsheetCtl',['$scope','$ionicActionSheet','$timeout' ,function($scope,$ionicActionSheet,$timeout){\n    $scope.show = function() {\n\n        var hideSheet = $ionicActionSheet.show({\n            buttons: [\n              { text: '&lt;b&gt;Share&lt;\/b&gt; This' },\n              { text: 'Move' }\n            ],\n            destructiveText: 'Delete',\n            titleText: 'Modify your album',\n            cancelText: 'Cancel',\n            cancel: function() {\n                 \/\/ add cancel code..\n               },\n            buttonClicked: function(index) {\n              return true;\n            }\n        });\n\n        $timeout(function() {\n            hideSheet();\n        }, 2000);\n\n    };  \n}])\n<\/pre>\n<p><a href=\"\/try\/tryit.php?filename=ionic_actionsheet\" target=\"_blank\"><button class=\"btn example-btn\">\u5c1d\u8bd5\u4e00\u4e0b \u00bb<\/button><\/a><\/p>\n<p>\u8fd0\u884c\u6548\u679c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2015\/08\/687474703a2f2f3776696a717a2e636f6d312e7a302e676c622e636c6f7564646e2e636f6d2f616374696f6e2d73686565742e6769662e676966.gif\"><\/p><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">ionic \u4e0a\u62c9\u83dc\u5355(ActionSheet) \u4e0a\u62c9\u83dc\u5355(ActionSheet)\u901a\u8fc7\u5f80\u4e0a&hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=735\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,26],"tags":[43,72,73,93],"class_list":["post-735","post","type-post","status-publish","format-standard","hentry","category-hybrid","category-mobile","tag-angular","tag-hybrid","tag-ionic","tag-mobile","zoom-theme-has-thumb"],"_links":{"self":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=735"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/735\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}