drawrect メソッドを使用し、たとえば CGRect UIColor のアルファ値を調整することで、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));
}
}