資源簡介
音樂播放器,支持歌詞同步顯示, 用于掌握tableView
代碼片段和文件信息
//
//??SongListViewController.m
//??MusicPlayer
//
//??Created?by?He?lingzhi?on?11/17/14.
//??Copyright?(c)?2014?com.duct.lecture8.?All?rights?reserved.
//
#import?“SongListViewController.h“
@interface?SongListViewController?()
@end
@implementation?SongListViewController
-?(id)initWithNibName:(NSString?*)nibNameOrNil?bundle:(NSBundle?*)nibBundleOrNil
{
????self?=?[super?initWithNibName:nibNameOrNil?bundle:nibBundleOrNil];
????if?(self)?{
????????//?Custom?initialization
????}
????return?self;
}
-?(void)viewDidLoad
{
????[super?viewDidLoad];
????//?Do?any?additional?setup?after?loading?the?view.
}
-?(void)didReceiveMemoryWarning
{
????[super?didReceiveMemoryWarning];
????//?Dispose?of?any?resources?that?can?be?recreated.
}
#pragma?mark?表視圖
-?(NSInteger)tableView:(UITableView?*)tableView?numberOfRowsInSection:(NSInteger)section?{
????
????return?[self.songArray?count];??//獲取歌曲數目
????
}
-?(UITableViewCell?*)tableView:(UITableView?*)tableView?cellForRowAtIndexPath:(NSIndexPath?*)indexPath?{
????
????
????UITableViewCell?*cell?=?[tableView?dequeueReusableCellWithIdentifier:@“SongCell“];
????
????//該表格選中后沒有顏色
???//?cell.selectionstyle?=?UITableViewCellSelectionstyleNone;
????
????//?cell?的背景色?設為透明色
????//cell.backgroundColor?=?[UIColor?clearColor];
????
????cell.textLabel.text?=?[?self.songArray[indexPath.row]?name];
????
????
????return?cell;
}
-(void)?tableView:(UITableView?*)tableView?didSelectRowAtIndexPath:(NSIndexPath?*)indexPath?{
????
??//??UITableViewCell??*?cell?=[tableView?cellForRowAtIndexPath:indexPath];
????
????//?獲取到當前被選中的行
???????
????[self.delegate?SongSelected:indexPath.row];
????
????[self?dismissViewControllerAnimated:YES?completion:nil]?;
}
@end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-11-17?11:07??01_MusicPla
?????文件???????12292??2014-11-17?11:37??01_MusicPla
?????目錄???????????0??2014-11-19?10:27??__MACOSX\
?????目錄???????????0??2014-11-19?10:27??__MACOSX\01_MusicPla
?????文件?????????120??2014-11-17?11:37??__MACOSX\01_MusicPla
?????目錄???????????0??2014-11-17?11:40??01_MusicPla
?????目錄???????????0??2014-11-16?12:49??01_MusicPla
?????文件??????????15??2014-11-16?12:49??01_MusicPla
?????文件?????????137??2014-11-16?12:49??01_MusicPla
?????文件??????????73??2014-11-16?12:49??01_MusicPla
?????文件??????????23??2014-11-16?12:49??01_MusicPla
?????目錄???????????0??2014-11-16?12:49??01_MusicPla
?????文件?????????452??2014-11-16?12:49??01_MusicPla
?????文件?????????896??2014-11-16?12:49??01_MusicPla
?????文件?????????189??2014-11-16?12:49??01_MusicPla
?????文件?????????398??2014-11-16?12:49??01_MusicPla
?????文件????????1642??2014-11-16?12:49??01_MusicPla
?????文件????????1352??2014-11-16?12:49??01_MusicPla
?????文件????????4951??2014-11-16?12:49??01_MusicPla
?????文件????????1239??2014-11-16?12:49??01_MusicPla
?????文件????????3611??2014-11-16?12:49??01_MusicPla
?????文件????????4592??2014-11-17?11:35??01_MusicPla
?????目錄???????????0??2014-11-16?12:49??01_MusicPla
?????文件??????????40??2014-11-16?12:49??01_MusicPla
?????目錄???????????0??2014-11-19?10:27??__MACOSX\01_MusicPla
?????目錄???????????0??2014-11-19?10:27??__MACOSX\01_MusicPla
?????文件?????????171??2014-11-16?12:49??__MACOSX\01_MusicPla
?????目錄???????????0??2014-11-16?12:49??01_MusicPla
?????文件?????????167??2014-11-16?12:49??01_MusicPla
?????目錄???????????0??2014-11-16?12:49??01_MusicPla
?????目錄???????????0??2014-11-16?12:49??01_MusicPla
............此處省略247個文件信息
評論
共有 條評論