{"rsdb":{"rid":"239142","subhead":"","postdate":"0","aid":"164842","fid":"99","uid":"1","topic":"1","content":"
\n

\u4ee5UIButton\u4e3a\u4f8b,\u521b\u5efa\u4e00\u4e2a\u7c7b\uff0c\u7ee7\u627f\u4e8eUIButton <\/h3> \n

\/*\u9875\u9762\u7684\u521b\u5efa\u7528storyboard*\/<\/p> \n

 .h\u6587\u4ef6 \u3000\u3000          <\/p> \n

@interface PTSRecommendButton : UIButton<\/p> \n

- (void)viewTransform;<\/p> \n

@end<\/p> \n

.m\u6587\u4ef6<\/p> \n

@implementation PTSRecommendButton<\/p> \n

- (void)viewTransform {<\/p> \n

    \/\/<\/p> \n

    [self.layer setAnchorPoint:CGPointMake(1, 0.5)];<\/p> \n

    CGRect btnFrame = self.frame;<\/p> \n

    \/\/\u8bbe\u7f6e\u4e2d\u5fc3\u70b9  AnchorPoint\u9ed8\u8ba4\u662f0.5<\/p> \n

    btnFrame.origin.x += btnFrame.size.width \/ 2 ;<\/p> \n

    self.frame = btnFrame;<\/p> \n

    \/\/\u653e\u5927<\/p> \n

    [UIView transitionWithView:self duration:0.5 options:UIViewAnimationOptionAllowUserInteraction animations:^{<\/p> \n

\u3000\u3000\u3000\/\/\u56e0\u4e3a\u662fbutton\u5728\u52a8\u753b\u4e4b\u884c\u7684\u8fc7\u7a0b\u70b9\u51fb\u5982\u679c\u6ca1\u6709\u9875\u9762\u8df3\u8f6c\u7684\u64cd\u4f5c\u3002\u8981\u8bbe\u7f6e\u4e0d\u80fd\u72d7\u88ab\u70b9\u51fb \u5426\u5219\u4f1a\u5f15\u8d77\u52a8\u753b\u65b9\u6cd5\u7684\u8986\u76d6 <\/p> \n

        \/\/self.userInteractionEnabled = NO;  <\/p> \n

        self.transform = CGAffineTransformMakeScale(1.2, 1.2);<\/p> \n

    } completion:^(BOOL finished) {<\/p> \n

        \/\/\u8fd8\u539f\u4e2d\u5fc3\u70b9<\/p> \n

        [self.layer setAnchorPoint:CGPointMake(0.5, 0.5)];<\/p> \n

        CGRect btnFrame = self.frame;<\/p> \n

        btnFrame.origin.x -= btnFrame.size.width \/ 2 ;<\/p> \n

        self.frame = btnFrame;<\/p> \n

        \/\/\u65cb\u8f6c<\/p> \n

        [UIView transitionWithView:self duration:0.25 options:UIViewAnimationOptionAllowUserInteraction animations:^{<\/p> \n

            \/\/<\/p> \n

            self.transform = CGAffineTransformRotate(self.transform, M_PI*0.05);<\/p> \n

        } completion:^(BOOL finished) {<\/p> \n

            \/\/\u53cd\u5411\u65cb\u8f6c<\/p> \n

            [UIView transitionWithView:self duration:0.5 options:UIViewAnimationOptionAllowUserInteraction animations:^{<\/p> \n

                self.transform = CGAffineTransformRotate(self.transform, -M_PI*0.1);<\/p> \n

            } completion:^(BOOL finished) {<\/p> \n

                \/\/\u56de\u5230\u6700\u521d\u65cb\u8f6c\u72b6\u6001<\/p> \n

                [UIView transitionWithView:self duration:0.25 options:UIViewAnimationOptionAllowUserInteraction animations:^{<\/p> \n

                    self.transform = CGAffineTransformRotate(self.transform, M_PI*0.05);<\/p> \n

                } completion:^(BOOL finished) {<\/p> \n

                    \/\/\u4e2d\u5fc3\u70b9\u8fd8\u539f<\/p> \n

                    [self.layer setAnchorPoint:CGPointMake(1, 0.5)];<\/p> \n

                    CGRect btnFrame = self.frame;<\/p> \n

                    btnFrame.origin.x += btnFrame.size.width \/ 2 ;<\/p> \n

                    self.frame = btnFrame;<\/p> \n

                    \/\/\u6062\u590d\u521d\u59cb\u7684\u72b6\u6001<\/p> \n

                    [UIView transitionWithView:self duration:0.5 options:UIViewAnimationOptionAllowUserInteraction animations:^{<\/p> \n

                       ","orderid":"0","title":"View\u7684\u653e\u5927->\u65cb\u8f6c->\u8fd8\u539f\u52a8\u753b(\u4e00)","smalltitle":"","mid":"0","fname":"iOS","special_id":"0","bak_id":"0","info":"0","hits":"11191","pages":"2","comments":"0","posttime":"2017-10-16 18:18:45","list":"1508149125","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"View<\/A> \u653e\u5927<\/A> -><\/A> \u65cb\u8f6c<\/A> \u8fd8\u539f<\/A> \u52a8\u753b<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"113.108.110.181","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"View\u7684\u653e\u5927->\u65cb\u8f6c->\u8fd8\u539f\u52a8\u753b","lastview":"1713477745","digg_num":"4934","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}