{"id":158,"date":"2016-03-11T17:34:48","date_gmt":"2016-03-11T09:34:48","guid":{"rendered":"http:\/\/www.yusian.com\/blog\/?p=158"},"modified":"2016-07-14T22:51:17","modified_gmt":"2016-07-14T14:51:17","slug":"%e8%87%aa%e5%ae%9a%e4%b9%89uiactionsheet%e5%ae%9e%e7%8e%b0%e5%88%86%e4%ba%ab%e5%8a%9f%e8%83%bd%ef%bc%8c%e4%b8%80%e8%a1%8c%e4%bb%a3%e7%a0%81%e6%90%9e%e5%ae%9a%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/project\/2016\/03\/11\/173448158.html","title":{"rendered":"\u81ea\u5b9a\u4e49UIActionSheet\u5b9e\u73b0\u5206\u4eab\u529f\u80fd\uff0c\u4e00\u884c\u4ee3\u7801\u641e\u5b9a\uff01"},"content":{"rendered":"<p><strong>1\u3001\u5148\u4e0a\u56fe\uff0c\u6709\u56fe\u597d\u8bf4\u8bdd<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.yusian.com\/blog\/wp-content\/uploads\/2016\/07\/Simulator-Screen-Shot-2016\u5e743\u670813\u65e5-\u4e0b\u53485.35.17.jpg\" alt=\"Simulator-Screen-Shot-2016\u5e743\u670813\u65e5-\u4e0b\u53485.35.17\" width=\"320\" height=\"568\" class=\"alignnone size-full wp-image-159\" \/><\/p>\n<p><strong>2\u3001\u8bbe\u7f6e\u601d\u8def<\/strong><\/p>\n<p>2.1\u3001\u6211\u5e0c\u671b\u8fd9\u662f\u4e00\u4e2aView\uff0c\u5e76\u975e\u63a7\u5236\u5668\uff0c\u8282\u7701\u5f00\u652f\uff1b<br \/>\n2.2\u3001 \u8fd9\u4e2aView\u5305\u542b\u4e00\u4e2a\u80cc\u666f\uff0c\u4e00\u4e2a\u9762\u677f\uff0c\u82e5\u5e72\u4e2a\u6309\u94ae\u6216\u6807\u7b7e\uff1b<br \/>\n2.3\u3001\u6211\u5e0c\u671b\u5b9e\u73b0\u7684\u529f\u80fd\u662f\u89c6\u56fe\u5c55\u793a+\u4e8b\u4ef6\u54cd\u5e94\uff1b<br \/>\n2.4\u3001\u5e0c\u671b\u65e0\u5076\u5408\u6027\uff0c\u5e76\u4e14\u4e00\u884c\u4ee3\u7801\u641e\u5b9a(\u80fd\u4e00\u884c\u4ee3\u7801\u641e\u5b9a\u7684\u5fc5\u5b9a\u5305\u542bblock)\uff1b<br \/>\n2.5\u3001\u8fd9\u82e5\u5e72\u4e2a\u6309\u94ae\u6700\u597d\u662f\u5916\u9762\u4f20\u8fdb\u6765\uff0c\u8981\u4e0d\u6211\u600e\u4e48\u77e5\u9053\u9700\u8981\u4ec0\u4e48\u6837\u7684\u6309\u94ae\uff1f\u4f20\u4e00\u7ec4\u56fe\u7247\uff1f\u90a3\u6587\u5b57\u5462\uff1f\u518d\u4f20\u4e00\u7ec4\u6587\u5b57\uff1f\u5982\u4f55\u5bf9\u5e94\uff1f<br \/>\n2.6\u3001\u6211\u5e0c\u671b\u5f00\u59cb\u8c03\u7528\u7684\u65f6\u5019\u53ea\u8981\u4f20\u6309\u94ae\u7ed9\u4f60\uff0c\u7ed3\u675f\u540e\u544a\u8bc9\u6211\u7528\u6237\u70b9\u4e86\u54ea\u4e2a\u6309\u94ae\uff0c\u5176\u4ed6\u7684\u6211\u90fd\u4e0d\u60f3\u7ba1(\u9ad8\u5ea6\u65e0\u5076\u5c01\u88c5)\uff0c\u5475\u5475\uff01<br \/>\n2.7\u3001\u8c03\u7528\u65f6\u8fd8\u6700\u597d\u662f\u7c7b\u65b9\u6cd5\uff0c\u6211\u4e0d\u559c\u6b22alloc\uff1b<!--more--><br \/>\n2.8\u3001\u4f8b\u5982\uff1a+ (instancetype)sheetWithItems:(NSArray<__kindof UIButton *> *)items actionWithBlock:(SAActionSheetBlock)block<\/p>\n<p><strong>3\u3001\u57fa\u672c\u8c03\u7528<\/strong><\/p>\n<pre lang=\"objc\" line=\"1\">\/\/\n\/\/? ViewController.m\n\/\/? Test\n\/\/\n\/\/? Created by \u4f59\u897f\u5b89 on 16\/3\/11.\n\/\/? Copyright ? 2016\u5e74 Sian. All rights reserved.\n\/\/\n?\n#import \"ViewController.h\"\n#import \"SAActionSheet.h\"\n?\n@interface ViewController ()\n?\n@end\n?\n@implementation ViewController\n?\n- (void)viewDidLoad\n{\n????[super viewDidLoad];\n}\n\/\/\/ \u5f39\u51fa\u5206\u4eab\u9762\u677f\n- (IBAction)action:(UIButton *)sender\n{\n????[SAActionSheet sheetWithItems:[self shareItems] actionWithBlock:^(UIButton *item, NSInteger index) {\n????????switch (index) {\n????????????case 1: [self show:@\"\u5fae\u4fe1\u597d\u53cb\"]; break;\n????????????case 2: [self show:@\"\u670b\u53cb\u5708\"]; break;\n????????????case 3: [self show:@\"\u5fae\u4fe1\u6536\u85cf\"]; break;\n????????????case 4: [self show:@\"QQ\u597d\u53cb\"]; break;\n????????????case 5: [self show:@\"QQ\u7a7a\u95f4\"]; break;\n????????????default: break;\n????????}\n????}];\n}\n\/\/\/ \u521b\u5efa\u6309\u94ae\u6570\u7ec4\n- (NSArray *)shareItems\n{\n????UIImage *image1 = [UIImage imageNamed:@\"Action_Share.png\"];\n????UIImage *image2 = [UIImage imageNamed:@\"Action_Moments.png\"];\n????UIImage *image3 = [UIImage imageNamed:@\"Action_MyFavAdd.png\"];\n????UIImage *image4 = [UIImage imageNamed:@\"Action_QQ.png\"];\n????UIImage *image5 = [UIImage imageNamed:@\"Action_qzone.png\"];\n????UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];\n????UIButton *button2 = [UIButton buttonWithType:UIButtonTypeSystem];\n????UIButton *button3 = [UIButton buttonWithType:UIButtonTypeSystem];\n????UIButton *button4 = [UIButton buttonWithType:UIButtonTypeSystem];\n????UIButton *button5 = [UIButton buttonWithType:UIButtonTypeSystem];\n????[button1 setBackgroundImage:image1 forState:UIControlStateNormal];\n????[button2 setBackgroundImage:image2 forState:UIControlStateNormal];\n????[button3 setBackgroundImage:image3 forState:UIControlStateNormal];\n????[button4 setBackgroundImage:image4 forState:UIControlStateNormal];\n????[button5 setBackgroundImage:image5 forState:UIControlStateNormal];\n????[button1 setTitle:@\"\u5fae\u4fe1\u597d\u53cb\" forState:UIControlStateNormal];\n????[button2 setTitle:@\"\u670b\u53cb\u5708\" forState:UIControlStateNormal];\n????[button3 setTitle:@\"\u5fae\u4fe1\u6536\u85cf\" forState:UIControlStateNormal];\n????[button4 setTitle:@\"QQ\u597d\u53cb\" forState:UIControlStateNormal];\n????[button5 setTitle:@\"QQ\u7a7a\u95f4\" forState:UIControlStateNormal];\n????return @[button1, button2, button3, button4, button5];\n}\n\/\/ \u9644\u5c5e\u65b9\u6cd5\uff0c\u663e\u793a\u7ed3\u679c\n- (void)show:(NSString *)string\n{\n????[[[UIAlertView alloc] initWithTitle:nil message:string delegate:nil cancelButtonTitle:@\"\u77e5\u9053\u4e86\" otherButtonTitles:nil, nil] show];\n}\n@end<\/pre>\n<p><strong>4\u3001\u4ee3\u7801\u5b9e\u73b0<\/strong><\/p>\n<pre lang=\"objc\" line=\"1\">\/\/\n\/\/? SAActionSheet.m\n\/\/? fisher\n\/\/\n\/\/? Created by \u4f59\u897f\u5b89 on 16\/3\/10.\n\/\/? Copyright ? 2016\u5e74 Sian. All rights reserved.\n\/\/\n#define kSAActionSheetItemColumns??? 3????? \/\/ \u6bcf\u884c\u6309\u94ae\u6570\uff08\u7eb5\u5217\u6570\uff09\n#define kSAActionSheetItemWidth????? 60???? \/\/ \u5355\u4e2a\u6309\u94ae\u957f\u5bbd\n#define kSAActionSheetItemSpace????? 25???? \/\/ \u6309\u94ae\u4e0a\u4e0b\u4e4b\u95f4\u95f4\u9694\n#define kSAActionSheetLabelHeight??? 25???? \/\/ \u6309\u94ae\u6807\u7b7e\u6587\u5b57\u9ad8\u5ea6\n#define kSAActionSheetCancelHeight?? 50???? \/\/ \u53d6\u6d88\u6309\u94ae\u9ad8\u5ea6\n#import \"SAActionSheet.h\"\n@interface SAActionSheet ()\n?\n@property (nonatomic, strong) UIView??? *baseView;????? \/\/ \u6309\u94ae\u57fa\u7840\u677f\n@property (nonatomic, strong) NSArray?? *items;???????? \/\/ \u6309\u94ae\u6570\u7ec4\n@property (nonatomic, strong) NSArray?? *labels;??????? \/\/ \u6309\u94ae\u6807\u7b7e\n@property (nonatomic, strong) UIButton? *cancel;??????? \/\/ \u53d6\u6d88\u6309\u94ae\n@property (nonatomic, copy) SAActionSheetBlock? block;? \/\/ \u5b8c\u6210Block\n?\n@end\n?\n@implementation SAActionSheet\n?\n+ (instancetype)sheetWithItems:(NSArray<__kindof UIButton *> *)items actionWithBlock:(SAActionSheetBlock)block\n{\n????SAActionSheet *sheet = [[self alloc] initWithItems:items actionWithBlock:block];\n????return [sheet show];\n}\n?\n- (instancetype)initWithItems:(NSArray<__kindof UIButton *> *)items actionWithBlock:(SAActionSheetBlock)block\n{\n????if (self = [super init]){\n????????\/\/ 1\u3001\u63a5\u6536\u53d8\u91cf\n????????self.block = block;\n????????self.items = items;\n????????\/\/ 2\u3001\u521b\u5efa\u57fa\u7840\u9762\u677f\u89c6\u56fe\uff08\u52a8\u753b\u5347\u4e0a\u6765\u7684\u90a3\u4e2a\u767d\u8272\u9762\u677f\uff0c\u7528\u6765\u653e\u5206\u4eab\u6309\u94ae\u3001\u6807\u7b7e\u7b49\uff09\n????????self.baseView = [[UIView alloc] init];\n????????self.baseView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:0.9];\n????????[self addSubview:self.baseView];\n????????\/\/ 3\u3001\u521b\u5efa\u5206\u4eab\u6309\u94ae\u53ca\u5bf9\u5e94\u6807\u7b7e\n????????NSMutableArray *labelArray = [NSMutableArray array];\n????????for (int i = 0; i < items.count; i++) {\n????????????\/\/ 3.1\u3001\u904d\u5386\u4f20\u8fdb\u6765\u7684\u6309\u94ae\u6570\u7ec4\uff0c\u5c06\u6bcf\u4e2a\u6309\u94ae\u6dfb\u52a0\u5230baseView\u4e0a\uff0c\u5e76\u5e8f\u53f7\u6dfb\u52a0tag\u6807\u8bb0\n????????????UIButton *button = [items objectAtIndex:i];\n????????????[button setTag:i + 1];\n????????????[self.baseView addSubview:button];\n????????????\/\/ 3.2\u3001\u521b\u5efa\u6309\u94ae\u6807\u7b7e\uff0c\u53d6\u51fa\u6807\u7b7e\u540e\u5c06\u6309\u94ae\u4e0a\u7684\u6587\u5b57\u5220\u9664\u6389\uff0c\u907f\u514d\u91cd\u590d\n????????????UILabel *label = [[UILabel alloc] init];\n????????????label.font = [UIFont systemFontOfSize:11];\n????????????label.textAlignment = NSTextAlignmentCenter;\n????????????label.text = [button titleForState:UIControlStateNormal];\n????????????[labelArray addObject:label];\n????????????[self.baseView addSubview:label];\n????????????\/\/ 3.3\u3001\u6dfb\u52a0\u6309\u94ae\u4e8b\u4ef6\u7edf\u4e00\u5904\u7406\u65b9\u6cd5\n????????????[button? setTitle:nil forState:UIControlStateNormal];\n????????????[button addTarget:self action:@selector(buttonEven:) forControlEvents:UIControlEventTouchUpInside];\n????????}\n????????self.labels = labelArray;\n????????\/\/ 4\u3001\u53d6\u6d88\u6309\u94ae\u5e76\u7ed1\u5b9a\u76f8\u5173\u4e8b\u4ef6\n????????self.cancel = [UIButton buttonWithType:UIButtonTypeSystem];\n????????[self.cancel addTarget:self action:@selector(hidden) forControlEvents:UIControlEventTouchUpInside];\n????????[self.cancel setBackgroundColor:[UIColor whiteColor]];\n????????[self.cancel setTitle:@\"\u53d6\u6d88\" forState:UIControlStateNormal];\n????????[self.cancel.titleLabel setFont:[UIFont systemFontOfSize:20]];\n????????[self.baseView addSubview:self.cancel];\n????????\/\/ 5\u3001\u70b9\u51fb\u7a7a\u767d\u533a\u57df\u54cd\u5e94\u53d6\u6d88\u4e8b\u4ef6\n????????[self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hidden)]];\n????}\n????return self;\n}\n\/\/\/ \u89c6\u56fe\u8c03\u6574\n- (void)layoutSubviews\n{\n????[super layoutSubviews];\n????\/\/ SAActionSheet Frame\uff1a\u80cc\u666f\u5927\u5c0f\n????self.frame = [[UIScreen mainScreen] bounds];\n????\/* BaseView Frame\uff1a\u57fa\u7840\u89c6\u56fe\u5c3a\u5bf8\n?????rows: \u4e3a\u6309\u94ae\u603b\u884c\u6570\n?????h: baseView\u89c6\u56fe\u7684\u9ad8 = (\u4e0a\u4e0b\u95f4\u9694\u9ad8\u5ea6 + \u6309\u94ae\u9ad8\u5ea6 + \u6807\u7b7e\u9ad8\u5ea6) * \u884c\u6570 + \u4e0a\u4e0b\u95f4\u9694\u9ad8\u5ea6 + \u53d6\u6d88\u6309\u94ae\u9ad8\u5ea6\n?????w: baseView\u89c6\u56fe\u7684\u5bbd = \u5c4f\u5e55\u5bbd\u5ea6\n?????*\/\n????NSInteger rows = (self.items.count - 1) \/ kSAActionSheetItemColumns + 1;\n????CGFloat h = rows * (kSAActionSheetItemWidth + kSAActionSheetItemSpace + kSAActionSheetLabelHeight) + kSAActionSheetItemSpace + kSAActionSheetCancelHeight;\n????CGFloat w = self.bounds.size.width;\n????self.baseView.bounds = CGRectMake(0, 0, self.bounds.size.width, h);\n????\/* Items Frame\uff1a\u6309\u94ae\u5c3a\u5bf8\n?????bw:? \u6309\u94ae\u5bbd\u5ea6\n?????bh:? \u6309\u94ae\u9ad8\u5ea6\n?????sp:? \u6309\u94ae\u95f4\u9694 = \uff08\u603b\u5bbd\u5ea6 - \u6309\u94ae\u4e2a\u6570 * \u6309\u94ae\u5bbd\u5ea6\uff09\/ \u95f4\u9694\u6570\n?????*\/\n????CGFloat bw = kSAActionSheetItemWidth;\n????CGFloat bh = kSAActionSheetItemWidth;\n????CGFloat sp = (w - bw * kSAActionSheetItemColumns) \/ (kSAActionSheetItemColumns + 1);\n????for (UIButton *button in self.items) {\n????????NSInteger index = button.tag;?? \/\/ \u6309\u94ae\u5e8f\u53f7\n????????NSInteger row = (index - 1) \/ kSAActionSheetItemColumns + 1;??? \/\/ \u884c\u5e8f\u53f7\n????????NSInteger col = (index - 1) % kSAActionSheetItemColumns + 1;??? \/\/ \u5217\u5e8f\u53f7\n????????\/\/ \u6309\u94aex\u503c\u3001y\u503c\n????????CGFloat x = (col - 1) * bw + col * sp;\n????????CGFloat y = (row - 1) * (bh + kSAActionSheetLabelHeight) + row * kSAActionSheetItemSpace;\n????????button.frame = CGRectMake(x, y, bw, bh);\n????????\/\/ \u5728\u6309\u94ae\u4e0b\u65b9\u8bbe\u7f6e\u76f8\u5bf9\u5e94\u7684\u6807\u7b7e\uff0c\u5bbd\u5ea6\u4e0e\u6309\u94ae\u76f8\u540c\uff0c\u9ad8\u5ea6\u4e3a\u9884\u8bbe\u5b9a\u503c\n????????UILabel *label = [self.labels objectAtIndex:index - 1];\n????????label.frame = CGRectMake(x, y + bh, bw, kSAActionSheetLabelHeight);\n????}\n????\/\/ \u53d6\u6d88\u6309\u94ae\u5728\u6700\u4e0b\u65b9\uff0c\u9ad8\u5ea6\u4e3a50\n????self.cancel.frame = CGRectMake(0, h - 50, w, kSAActionSheetCancelHeight);\n}\n?\n\/\/\/ \u663e\u793a\u89c6\u56fe\uff08\u5f39\u51fa\u52a8\u753b\uff09\n- (SAActionSheet *)show\n{\n????\/\/ 1\u3001\u8c03\u6574\u89c6\u56fe\u5927\u5c0f\uff0c\u6dfb\u52a0\u5230\u5f53\u524dWindows\u7a97\u53e3\n????[self layoutSubviews];\n????[[[[UIApplication sharedApplication] delegate] window] addSubview:self];\n????\/\/ 2\u3001\u5c06\u57fa\u7840\u89c6\u56fe\u8c03\u6574\u5230\u5c4f\u5e55\u6700\u4e0b\u65b9\u3001\u80cc\u666f\u8bbe\u7f6e\u900f\u660e\n????CGFloat height = self.bounds.size.height;\n????CGFloat w = self.baseView.bounds.size.width;\n????CGFloat h = self.baseView.bounds.size.height;\n????self.backgroundColor = [UIColor clearColor];\n????self.baseView.center = CGPointMake(w * 0.5, height + h * 0.5);\n????\/\/ 3\u3001\u6267\u884c\u81ea\u4e0b\u81f3\u4e0a\u7684\u63a8\u51fa\u53ca\u80cc\u666f\u53d8\u534a\u900f\u660e\u9ed1\u7684\u52a8\u753b\n????[UIView animateWithDuration:0.25 animations:^{\n????????self.baseView.center = CGPointMake(w * 0.5, height - h * 0.5);\n????????self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];\n????}];\n????return self;\n}\n?\n\/\/\/ \u9690\u85cf\u89c6\u56fe\uff08\u9000\u51fa\u91ca\u653e\uff09\n- (void)hidden\n{\n????\/\/ \u6309\u952e\u89c6\u56fe\u5757\u6574\u4f53\u4e0b\u79fb\u81f3\u8d85\u51fa\u5c4f\u5e55\u52a8\u753b\uff0c\u80cc\u666f\u53d8\u900f\u660e\uff0c\u52a8\u753b\u7ed3\u675f\u540e\u5c06\u89c6\u56fe\u4ece\u7a97\u53e3\u79fb\u9664\n????CGFloat height = self.bounds.size.height;\n????CGFloat w = self.baseView.bounds.size.width;\n????CGFloat h = self.baseView.bounds.size.height;\n????[UIView animateWithDuration:0.35 animations:^{\n????????self.baseView.center = CGPointMake(w * 0.5, height + h * 0.5);\n????????self.backgroundColor = [UIColor clearColor];\n????} completion:^(BOOL finished) {\n????????[self removeFromSuperview];\n????}];\n}\n?\n\/\/\/ \u6309\u94ae\u4e8b\u4ef6\u8f6c\u4ea4\u7ed9Block\u5904\u7406\n- (void)buttonEven:(UIButton *)button\n{\n????\/\/ \u5c06\u4e8b\u4ef6\u53ca\u89e6\u53d1\u4e8b\u4ef6\u7684\u6309\u94ae\u5e8f\u53f7\u8f6c\u4ea4\u51fa\u53bb\uff0c\u5e76\u53d6\u6d88\u89c6\u56fe\n????if (self.block) self.block(button, button.tag);\n????[self hidden];\n}\n@end<\/pre>\n<p><strong>5\u3001Demo\u4e0b\u8f7d<\/strong><br \/>\n<a href=\"http:\/\/www.yusian.com\/blog\/wp-content\/uploads\/2016\/07\/SAShare.zip\">SAShare<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5148\u4e0a\u56fe\uff0c\u6709\u56fe\u597d\u8bf4\u8bdd 2\u3001\u8bbe\u7f6e\u601d\u8def 2.1\u3001\u6211\u5e0c\u671b\u8fd9\u662f\u4e00\u4e2aView\uff0c\u5e76\u975e\u63a7\u5236\u5668\uff0c\u8282\u7701\u5f00\u652f\uff1b 2.2\u3001 \u8fd9\u4e2aView\u5305\u542b\u4e00\u4e2a\u80cc\u666f\uff0c\u4e00\u4e2a\u9762\u677f\uff0c\u82e5\u5e72\u4e2a\u6309\u94ae\u6216\u6807\u7b7e\uff1b 2.3\u3001\u6211\u5e0c\u671b\u5b9e\u73b0\u7684\u529f\u80fd\u662f\u89c6\u56fe\u5c55\u793a+\u4e8b\u4ef6\u54cd\u5e94\uff1b 2.4\u3001\u5e0c\u671b\u65e0\u5076\u5408\u6027\uff0c\u5e76\u4e14\u4e00\u884c\u4ee3\u7801\u641e\u5b9a(\u80fd\u4e00\u884c\u4ee3\u7801\u641e\u5b9a\u7684\u5fc5\u5b9a\u5305\u542bblock)\uff1b 2.5\u3001\u8fd9\u82e5\u5e72\u4e2a\u6309\u94ae\u6700\u597d\u662f\u5916\u9762\u4f20\u8fdb\u6765\uff0c\u8981\u4e0d\u6211\u600e\u4e48\u77e5\u9053\u9700\u8981\u4ec0\u4e48\u6837\u7684\u6309\u94ae\uff1f\u4f20\u4e00\u7ec4\u56fe\u7247\uff1f\u90a3\u6587\u5b57\u5462\uff1f\u518d\u4f20\u4e00\u7ec4\u6587\u5b57\uff1f\u5982\u4f55\u5bf9\u5e94\uff1f 2.6\u3001\u6211\u5e0c\u671b\u5f00\u59cb\u8c03\u7528\u7684\u65f6\u5019\u53ea\u8981\u4f20\u6309\u94ae\u7ed9\u4f60\uff0c\u7ed3\u675f\u540e\u544a\u8bc9\u6211\u7528\u6237\u70b9\u4e86\u54ea\u4e2a\u6309\u94ae\uff0c\u5176\u4ed6\u7684\u6211\u90fd\u4e0d\u60f3\u7ba1(\u9ad8\u5ea6\u65e0\u5076\u5c01\u88c5)\uff0c\u5475\u5475\uff01 2.7\u3001\u8c03\u7528\u65f6\u8fd8\u6700\u597d\u662f\u7c7b\u65b9\u6cd5\uff0c\u6211\u4e0d\u559c\u6b22alloc\uff1b<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[15,17],"class_list":["post-158","post","type-post","status-publish","format-standard","hentry","category-project","tag-module","tag-skill"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=158"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/158\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}