设为首页 加入收藏

TOP

控制系统音量,自定义MPVolumeView(二)
2015-07-24 05:54:35 来源: 作者: 【 】 浏览:9
Tags:控制系统 音量 定义 MPVolumeView
nge { [[MPMusicPlayerController applicationMusicPlayer] setVolume:self.volumeSlider.value]; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ for(UITouch *touch in event.allTouches) { self.firstPoint = [touch locationInView:self.view]; } UISlider *slider = (UISlider *)[self.view viewWithTag:1000]; slider.value = self.slider.value; NSLog(@"touchesBegan"); } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ for(UITouch *touch in event.allTouches) { self.secondPoint = [touch locationInView:self.view]; } NSLog(@"firstPoint==%f || secondPoint===%f",self.firstPoint.y,self.secondPoint.y); NSLog(@"first-second==%f",self.firstPoint.y - self.secondPoint.y); self.slider.value += (self.firstPoint.y - self.secondPoint.y)/500.0; UISlider *slider = (UISlider *)[self.view viewWithTag:1000]; slider.value = self.slider.value; NSLog(@"value == %f",self.slider.value); self.firstPoint = self.secondPoint; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"touchesEnded"); self.firstPoint = self.secondPoint = CGPointZero; }


源码下载:http://download.csdn.net/detail/woshiwls/7548545

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C++命名空间和自定义头文件 下一篇Codeforces 8D Two Friends 三分+..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: