【发布时间】:2015-10-22 06:39:56
【问题描述】:
我是 swift 新手,我正在尝试拥有一个 UITableView,并且单元格将被动画化以一一出现。我怎样才能做到这一点?此外,如果新出现的单元格行不在屏幕上(隐藏在表格下方)。当每个单元格出现时,如何将表格向上移动?
var tableData1: [String] = ["1", "2", "3", "4", "5", "6", "7"]
override func viewWillAppear(animated: Bool) {
tableView.scrollEnabled=false
tableView.alpha=0.0
NSTimer.scheduledTimerWithTimeInterval(NSTimeInterval(3), target: self, selector: "animateTable", userInfo: nil, repeats: false)
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.tableData1.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:TblCell = self.tableView.dequeueReusableCellWithIdentifier("cell") as! TblCell
cell.lblCarName.textAlignment = NSTextAlignment.Justified;
return cell
}
func animateTable() {
//what should be the code?//
}
【问题讨论】:
标签: ios swift uitableview animation