仿 jing.fm 的音樂播放iOS視圖:JingRound

jopen 10年前發布 | 14K 次閱讀 JingRound iOS開發 移動開發

JingRound 是一款仿 jing.fm 的音樂播放視圖,支持旋轉和自定義參數。

仿 jing.fm 的音樂播放iOS視圖:JingRound

使用說明(Usage):

可以在Storybord、Xib直接拖個View然后更改其類為JingRoundView,設置基本屬性即可:

You can Drag and Drop a UIView in Storybord or Xib,and then change its class JingRoundView, set the basic parameter:

//設置代理,獲取回調事件
self.roundView.delegate = self;
//設置中間的圖像
self.roundView.roundImage = [UIImage imageNamed:@"girl"]; 
//設置轉圈的速度
self.roundView.rotationDuration = 8.0;
//起始狀態,轉or不轉
self.roundView.isPlay = NO;

暫停與播放(pause and play):

[self.roundView play];
[self.roundView pause];

當點擊中間圓盤的時候會觸發暫停、播放事件,當然有一個協議:JingRoundViewDelegate

When you touch in the middle of the disc when it will trigger the pause, play events, of course, there is a delegate JingRoundViewDelegate:

-(void)playStatuUpdate:(BOOL)playState
{
    NSLog(@"%@...", playState ? @"播放": @"暫停了");
}

使用的時候需要引入一下這兩個庫:

Of course, you need to import two framework:

#import <QuartzCore/QuartzCore.h>
#import <CoreGraphics/CoreGraphics.h>

項目主頁:http://www.baiduhome.net/lib/view/home/1390373282367

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!