iOS播放音乐,毛玻璃效果

来源:互联网 发布:软件二次开发价格标准 编辑:程序博客网 时间:2024/06/08 08:56
播放音乐1.找到文件路径  NSString *path=[[NSBundle mainBundle] pathForResource:@"灵魂尽头" ofType:@"mp3"];    self.play=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil];2.播放    [self.play play];    [_play release];毛玻璃效果1.创建一个imageview添加毛玻璃效果       UIImageView *imageview=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"0.jpg"]];    imageview.frame=CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);    [self.view addSubview:imageview];    [imageview release];2.创建一个毛玻璃效果    UIBlurEffect *effect=[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];3.创建一个毛玻璃视图.指定效果    UIVisualEffectView *efficview=[[UIVisualEffectView alloc] initWithEffect:effect];4.另效果大小与imageview大小相同    efficview.frame=imageview.frame;5.把效果添加给imageview    [imageview addSubview:efficview];

0 0
原创粉丝点击