在网上看到一个不错的封装,导入代码直接可以使用,废话不多说直接上代码:
.h文件
#import <Foundation/Foundation.h>
@interface SJAvatarBrowser : NSObject
+(void)showImage:(UIImageView*)avatarImageView;
@end
.m文件
#import "SJAvatarBrowser.h"
static CGRect oldframe;
@implementation SJAvatarBrowser
+(void)showImage:(UIImageView *)avatarImageView{
UIImage *image=avatarImageView.image;
UIWindow *window=[UIApplication sharedApplication].keyWindow;
UIView *backgroundView=[[UIView alloc