テーブルビューのセル内でUILabelを点滅させるuiTableViewCellに無限のアニメーションを追加しました。私のために働いたUIView.animateWithDurationはuitableviewcellをスクロールした後に終了します
UIView.commitAnimations():
私の問題は、私はそれだけで点滅
私のコードは
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("TripListCell", forIndexPath: indexPath) as! TripListCell
let trip = tripList[indexPath.section]
cell.lblTripDirection.textColor = UIColor(red: 51/255, green: 210/255, blue: 123/255, alpha: 1.0)
UIView.animateWithDuration(0.5, delay: 0.0, options: [.CurveEaseInOut, .Repeat, .Autoreverse, .AllowUserInteraction], animations: {
cell.lblTripDirection.alpha = 0.0
}, completion: {
bool in
cell.lblTripDirection.alpha = 1.0
cell.lblTripDirection.textColor = UIColor.blackColor()
})
return cell
}
アップデートで停止したテーブルビューをスクロールしたときに、です。 は、カスタムセルTripListCell
prepareForReuse
でのUITableViewCellのprepareForReuse
メソッドをオーバーライドすることができ、あなたにみんな:)
どこでUIView.commitAnimations()を宣言しましたか?実際の例がありますか? –