【问题标题】:UIImagePickerController blurry overlayview?UIImagePickerController 模糊覆盖视图?
【发布时间】:2013-07-12 21:35:09
【问题描述】:

我知道可以通过使用 drawrect 方法和调整 CGRect UIColor 的 alpha 值在 UIImagePickerController 上添加透明/半透明覆盖视图。但是是否有可能获得模糊效果而不是半透明效果?我希望我足够清楚...... 谢谢!

编辑(添加代码)

- (void)drawRect:(CGRect)rect{

CGFloat toolbarSize = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 0 : 80;

CGFloat width = CGRectGetWidth(self.frame);
CGFloat height = CGRectGetHeight(self.frame) - toolbarSize;

CGFloat heightSpan = floor(height / 2 - self.cropSize.height / 2);
CGFloat widthSpan = floor(width / 2 - self.cropSize.width  / 2);

//fill outer rect
[[UIColor colorWithRed:0. green:0. blue:0. alpha:0.5] set];
UIRectFill(self.bounds);

//fill inner border
[[UIColor colorWithRed:1. green:1. blue:1. alpha:0.5] set];
UIRectFrame(CGRectMake(widthSpan - 1, heightSpan - 1, self.cropSize.width + 2, self.cropSize.height + 2));

//fill inner rect
[[UIColor clearColor] set];
UIRectFill(CGRectMake(widthSpan, heightSpan, self.cropSize.width, self.cropSize.height));


}
}

【问题讨论】:

    标签: iphone ios overlay uiimagepickercontroller blur


    【解决方案1】:

    我使用这个框架来实现模糊的视图,对我来说效果很好

    FXBlurView

    【讨论】:

      猜你喜欢
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多