码迷,mamicode.com
首页 > 移动开发 > 详细

iOS基础-播放暂停按钮

时间:2015-10-03 20:45:52      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:

[btn setImage:[UIImage imageWithName:@"paly"] forState:UIControlStateNormal];

  

[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];

  

- (void)btnClick:(UIButton *)btn{
     if(btn.tag == -1){
      [btn setImage:[UIImage imageWithName:@"paly"] forState:UIControlStateNomal];
NSLog(@"开始播放"); btn.tag = 0; }else{ [btn setImage:[UIImage imageWithName:@"pause"] forState:UIControlStateNomal];
NSLog(@"暂停播放"); btn.tag = -1; } }

  

 

iOS基础-播放暂停按钮

标签:

原文地址:http://www.cnblogs.com/dingjianjaja/p/4853771.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!