ios 毛玻璃特效

來源:互聯網
上載者:User

標籤:ios   ios開發   可視化   uiimageview   圖片   

昨天晚上突然心血來潮,研究了下ios 8的毛半透明效果,覺得挺好看的。給人一種朦朧美,於是就動手實現了下代碼。--- 對了飛鳥圖的資源美審核通過大家不能下載了,非常抱歉。不過道理都是一樣,圖片哪裡都有。最主要是把知識點掌握了。哈哈,那麼我們就學習今天的毛半透明效果吧。


#import "ViewController.h"


@interface ViewController ()

{

    UIImageView *_imageView;

}

@end


@implementation ViewController


- (void)viewDidLoad {

    [superviewDidLoad];


    [selfcreateView];

    [selfcreatevisualEfView];

    

}


-(void)createView

{

    UIImageView *imageView = [[UIImageViewalloc]initWithFrame:CGRectMake(50,50, 300,400)];

    [imageView setImage:[UIImageimageNamed:@"webwxgetmsgimg.jpg"]];

    

    [self.viewaddSubview:imageView];

    

    

  

    _imageView = imageView;

    

}


//建立可視化視圖

-(void)createvisualEfView

{

       UIVisualEffectView *vis  =[[UIVisualEffectViewalloc] initWithEffect:[UIBlurEffecteffectWithStyle:UIBlurEffectStyleExtraLight]];//裡面有三種方法可以拿來調用

    

    vis.frame =CGRectMake(0,0, 300,400);

    vis.alpha =1.0;

    [_imageViewaddSubview:vis ];

}



這裡面一共3種效果,大家可以去方法裡面看,我們要有探索和冒險精神不是麼。


ios 毛玻璃特效

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.