如何在动画制作时让UIImageView超越/高于其他子视图/ UIImageView?请检查图片中的白王
UIView.animateWithDuration(3, animations:{
self.squares[moveInfo.start.0][moveInfo.start.1].occupyingPieceImageView.frame =
self.squares[moveInfo.end.0][moveInfo.end.1].frame
}
答案 0 :(得分:2)
UIView.animateWithDuration(3, animations:{
self.view.bringSubViewToFront(self.squares[moveInfo.start.0][moveInfo.start.1].occupyingPieceImageView)
self.squares[moveInfo.start.0][moveInfo.start.1].occupyingPieceImageView.frame =
self.squares[moveInfo.end.0][moveInfo.end.1].frame
}
答案 1 :(得分:1)
如果piece
是您希望在其兄弟姐妹面前的UIImageView
,请使用:
piece.superview?.bringSubviewToFront(piece)