音频播放,gif图的播放,毛玻璃效果 UISlider,UIStepper,UISegmentedControl

来源:互联网 发布:iphone视频截图软件 编辑:程序博客网 时间:2024/06/05 19:05

//音频播放功能

//    self.stepper=[[UIStepper alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];

//    [self.view addSubview:self.stepper];

//    self.stepper.stepValue=2;

//    [self.stepper addTarget:self action:@selector(stepAction:) forControlEvents:UIControlEventValueChanged];

//    [_stepper release];

//    

//    NSString *path=[[NSBundle mainBundle] pathForResource:@"1" ofType:@"mp3"];

//    self.play=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil];

//    [self.play play];

//    [_play release];

    

    //毛玻璃效果

//    UIImageView *imageView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"160.jpg"]];

//    imageView.frame=CGRectMake(0, 0, self.view.frame.size.width,200);

//    [self.view addSubview:imageView];

//    [imageView release];

//    //先创建一个毛玻璃的效果

//    UIBlurEffect *effect=[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

//    //创建一个毛玻璃视图,指定效果 iOS8.0之后出现的效果

//    UIVisualEffectView *effectView=[[UIVisualEffectView alloc] initWithEffect:effect];

//    

//    effectView.frame=imageView.frame;

//    [imageView addSubview:effectView];

//    //播放GIF

//    self.tomcatImageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 375, 400)];

//    [self.view addSubview:self.tomcatImageView];

//    [_tomcatImageView release];

//    

//    //容器使用之前,一定要对容器进行初始化

//    self.picArr=[NSMutableArray array];

//    for (NSInteger i=0; i<81; i++) {

//        //拼接图片的名称

//        NSString *pinName=[NSString stringWithFormat:@"knockout_%02ld.jpg",i];

//        //根据图片名找到对应的图片

//        UIImage *image=[UIImage imageNamed:pinName];

//        //把图片添加到数组中

//        [self.picArr addObject:image];

//    }

//    //

//    self.tomcatImageView.animationImages=self.picArr;

//    //执行的时间

//    self.tomcatImageView.animationDuration=5;

//    //执行的次数

//    self.tomcatImageView.animationRepeatCount=10;

//    [self.tomcatImageView startAnimating];

//    

//    

//    self.slider=[[UISlider alloc] initWithFrame:CGRectMake(130, 450, 100, 100)];

//    [self.view addSubview:self.slider];

//    [_slider release];

//    //最大值,最小值

//    self.slider.minimumValue=0.5;

//    self.slider.maximumValue=5;

//    [self.slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];

//    

//    

//    NSArray *arr=[[NSArray alloc] initWithObjects:@"1",@"2",@"3",nil];

//    self.seg=[[UISegmentedControl alloc] initWithItems:arr];

//    self.seg.frame=CGRectMake(280, 500, 100, 100);

//    self.seg.backgroundColor=[UIColor yellowColor];

//    [self.view addSubview:self.seg];

//    [_seg release];

//    

//    [self.seg addTarget:self action:@selector(segAction) forControlEvents:UIControlEventValueChanged];






0 0
原创粉丝点击