iOS8 只带毛玻璃效果API(UIVisualEffectView)
来源:互联网 发布:淘宝ti5冠军盾 编辑:程序博客网 时间:2024/04/29 03:12
01.
typedef NS_ENUM(NSInteger, UIBlurEffectStyle) {
02.
UIBlurEffectStyleExtraLight,
03.
UIBlurEffectStyleLight,
04.
UIBlurEffectStyleDark
05.
} NS_ENUM_AVAILABLE_IOS(8_0);
06.
07.
NS_CLASS_AVAILABLE_IOS(8_0)
@interface
UIVisualEffect : NSObject <NSCopying, NSSecureCoding>
@end
08.
09.
/* UIBlurEffect will provide a blur that appears to have been applied to the content layered behind the UIVisualEffectView. Views added to the contentView of a blur visual effect are not blurred themselves. */
10.
NS_CLASS_AVAILABLE_IOS(8_0)
@interface
UIBlurEffect : UIVisualEffect
11.
+ (UIBlurEffect *)effectWithStyle:(UIBlurEffectStyle)style;
12.
@end
13.
14.
/* UIVibrancyEffect amplifies and adjusts the color of content layered behind the view, allowing content placed inside the contentView to become more vivid. It is intended to be placed over, or as a subview of, a UIVisualEffectView that has been configured with a UIBlurEffect. This effect only affects content added to the contentView. Because the vibrancy effect is color dependent, subviews added to the contentView need to be tintColorDidChange aware and must be prepared to update themselves accordingly. UIImageView will need its image to have a rendering mode of UIImageRenderingModeAlwaysTemplate to receive the proper effect.
15.
*/
16.
NS_CLASS_AVAILABLE_IOS(8_0)
@interface
UIVibrancyEffect : UIVisualEffect
17.
+ (UIVibrancyEffect *)effectForBlurEffect:(UIBlurEffect *)blurEffect;
18.
@end
19.
20.
NS_CLASS_AVAILABLE_IOS(8_0)
@interface
UIVisualEffectView : UIView <NSSecureCoding>
21.
@property
(nonatomic, retain, readonly) UIView *contentView;
// Do not add subviews directly to UIVisualEffectView, use this view instead.
22.
@property
(nonatomic, copy, readonly) UIVisualEffect *effect;
23.
- (instancetype)initWithEffect:(UIVisualEffect *)effect NS_DESIGNATED_INITIALIZER;
24.
@end
@测试代码:
01.
// 图片
02.
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(
10
,
100
,
300
,
400
)];
03.
[imageView setImage:[UIImage imageNamed:@
"IMG_0015.JPG"
]];
04.
[self.view addSubview:imageView];
05.
06.
// blur效果
07.
self.visualEfView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
08.
_visualEfView.frame = CGRectMake(
0
,
0
,
300
,
400
);
09.
_visualEfView.alpha =
1.0
;
10.
[imageView addSubview:_visualEfView];
学习下。
1 0
- iOS8 只带毛玻璃效果API(UIVisualEffectView)
- iOS8 的毛玻璃效果(UIVisualEffectView)
- iOS8 模糊视图(毛玻璃效果) UIVisualEffectView
- iOS8中用UIVisualEffectView实现高斯模糊视图(毛玻璃效果)
- iOS8中用UIVisualEffectView实现高斯模糊视图(毛玻璃效果)
- iOS_8_API:UIVisualEffectView (毛玻璃效果)
- UIVisualEffectView用法 毛玻璃效果
- iOS8 苹果自带的毛玻璃效果
- UIVisualEffectView 毛玻璃效果的应用
- 模糊视图(毛玻璃效果) - UIVisualEffectView
- iOS8 毛玻璃效果
- iOS8 毛玻璃效果
- iOS8 毛玻璃效果实现
- iOS8+毛玻璃效果
- iOS8 添加毛玻璃效果
- iOS8使用UIVisualEffectView实现模糊效果
- iOS8使用UIVisualEffectView实现模糊效果
- iOS8 中 UIVisualEffectView 模糊效果的使用
- 动态树LCT(SPOJ375)
- android PorterDuffXfermode ,PorterDuff.Mode 使用 以及Porter-Duff规则详解
- iOS dealloc方法没有调用
- ava多线程(六)之Deque与LinkedBlockingDeque深入分析
- [www.infoshare.cc]MonkeyRunner(1)——基本使用方法,一驾考宝典这款APP为例
- iOS8 只带毛玻璃效果API(UIVisualEffectView)
- 关于C语言内存对齐
- Caffe学习特征可视化的一点代码问题.
- WebViewJavascriptBridge 原理分析
- Android仿真器,模拟器 提速——仿真器Genymotion
- chcp使用
- ajax提交form的方法
- KMP算法学习
- struct stat结构体的详解和用法