码迷,mamicode.com
首页 > 其他好文 > 详细

从系统相册选择照片时,没有选框,相册无选框

时间:2015-07-24 15:34:34      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (navigationController.viewControllers.count != 3) return;
    
    CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;
    
    UIView *plCropOverlay = [viewController.view.subviews[1] subviews][0];
    
    plCropOverlay.hidden = YES;
    
    int position = 0;
    
    position = (screenHeight == 568) ? 124 : 80;
    
    CAShapeLayer *circleLayer = [CAShapeLayer layer];
    
    UIBezierPath *path2 = [UIBezierPath bezierPathWithOvalInRect:
                           CGRectMake(0.0f, position, SCREEN_WIDTH, 320.0f)];
    [path2 setUsesEvenOddFillRule:YES];
    
    [circleLayer setPath:[path2 CGPath]];
    
    [circleLayer setFillColor:[[UIColor clearColor] CGColor]];
    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH, screenHeight-72) cornerRadius:0];
    
    [path appendPath:path2];
    [path setUsesEvenOddFillRule:YES];
    
    CAShapeLayer *fillLayer = [CAShapeLayer layer];
    fillLayer.path = path.CGPath;
    fillLayer.fillRule = kCAFillRuleEvenOdd;
    fillLayer.fillColor = [UIColor clearColor].CGColor;
    fillLayer.opacity = 0.8;
    [viewController.view.layer addSublayer:fillLayer];
        
    
}

 

从系统相册选择照片时,没有选框,相册无选框

标签:

原文地址:http://www.cnblogs.com/songxing10000/p/4673513.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!