欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

iOS 8使用UIBlurEffect實現(xiàn)毛玻璃特效

 更新時間:2018年05月02日 10:51:11   作者:zper  
這篇文章主要為大家詳細(xì)介紹了iOS 8使用UIBlurEffect類和UIVisualEffectView類實現(xiàn)毛玻璃特效,具有一定的參考價值,感興趣的小伙伴們可以參考一下

iOS 8 后使用UIBlurEffect 類和UIVisualEffectView 類添加毛玻璃特效更加便捷,高效。

//創(chuàng)建ImageView
IImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"5"]];
  // 創(chuàng)建需要的毛玻璃特效類型
  /**
   * UIBlurEffectStyleExtraLight,
   * UIBlurEffectStyleLight,
   * UIBlurEffectStyleDark
   */
  UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];

  //添加到要有毛玻璃特效的控件中
  UIVisualEffectView *visual = [[UIVisualEffectView alloc] initWithEffect:blur];
  visual.frame = imageView.bounds;
  [self.view addSubview:imageView];

效果圖:

原圖:

(1) UIBlurEffectStyleExtraLight

(2) UIBlurEffectStyleLight

(3) UIBlurEffectStyleDark

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論