youku觀看地址http://v.youku.com/v_show/id_XNzMxODQzNDIw.html
這是一個很酷的動畫效果。特別是數據多的時候
知識點
在單元格(Cell)顯示方法中設置動畫
func tableView(tableView: UITableView!, willDisplayCell cell: UITableViewCell!, forRowAtIndexPath indexPath: NSIndexPath!){ cell.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1) UIView.animateWithDuration(0.25, animations: { cell.layer.transform=CATransform3DMakeScale(1, 1, 1) }) }
willDisplayCell 顧名思義。就是在Cell顯示之前。
設置cell的層(layer)的變換(transform)為CATransform3DMakeScale做一個縮放動畫。X,y方向的縮放從0.1到1
高清視頻與代碼下載地址
http://pan.baidu.com/s/1sjHd5qX
Swift實戰-豆瓣電台系列