保存当前view到相册

import <QuartzCore/QuartzCore.h>

要响应的方法里面添加:


 
    UIGraphicsBeginImageContext(currentView.bounds.size);     //currentView 当前的view
    [currentView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
 

posted on 2012-11-16 17:40  无量少年  阅读(143)  评论(0编辑  收藏  举报

导航