//弹出时的动画
-(void)addAnimation : (CGRect )sortFrame
{
pBookSortView.alpha=0;
pBookSortView.transform=CGAffineTransformMakeScale(0.02, 0.02);
[UIView animateWithDuration:0.4f animations:^{
pBookSortView.transform=CGAffineTransformMakeScale(1.0, 1.0);
pBookSortView.alpha=1;
pBookSortView.frame=sortFrame;
}];
}
关闭动画的效果
CGFloat frameX=DEVICE_WIDTH-40;
CGFloat frameY= 2+VIEW_OFFSET_Y+40;
self.view.alpha=1.0;
self.view.transform=CGAffineTransformMakeScale(1.0, 1.0);
// 动画
[UIView animateWithDuration:0.3f animations:^{
self.view.transform=CGAffineTransformMakeScale(0.02f, 0.02f);
self.view.alpha=0.0;
CGRect rect=self.view.frame;
pSortBgView.frame=CGRectMake(frameX, frameY, rect.size.width, rect.size.height);
} completion:^(BOOL finished) {
[self.view removeFromSuperview];
self.view = nil;
}];