要求:
- Platform: iOS8.0+
- Language: Swift3.1
- Editor: Xcode8.3+
實(shí)現(xiàn):
- UITableView的橫向滾動(dòng)
看到網(wǎng)上公認(rèn)的一種比較簡單的方法是旋轉(zhuǎn)tableView和cell.contentView
// tableView旋轉(zhuǎn)-90°
tableView.transform = CGAffineTransform(rotationAngle: -.pi/2)
// cell.contentView反向旋轉(zhuǎn)90°
cell.contentView.transform = CGAffineTransform(rotationAngle: .pi/2)
- 卡片式布局
- table view設(shè)置
tableView.isPagingEnabled = true // 分頁
tableView.rowHeight = view.bounds.width // cell高度
tableView.separatorStyle = .none // 分割線樣式
github
https://github.com/BackWorld/TableViewHorizontalScroll
如果對你有幫助沈撞,別忘了點(diǎn)個(gè)??哦蚣录。