毛玻

作者: 傲骨天成科技 | 来源:发表于2016-01-12 21:17 被阅读184次

import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    //添加照片
    UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    UIImage *image=[UIImage imageNamed:@"headImage.png"];
    imageView.image=image;
    [self.window addSubview:imageView];

//毛玻璃效果  也可以给View,把View的背景颜色变淡了
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc]initWithEffect:effect];
visualEffectView.alpha = 0.9;
[visualEffectView setFrame:imageView.bounds];
[imageView addSubview:visualEffectView];




return YES;

}

相关文章

网友评论

    本文标题: 毛玻

    本文链接:https://www.haomeiwen.com/subject/pprckttx.html