0
어떻게 특정 CGPoint로 이동하려면 프로그래밍 방식으로 생성 된 객체에 애니메이션을 적용 할 수 있습니까? 이것은 CGAffineTransformMakeTranslation을 사용하지 않고, 이동하는 방법에 관한 것이기 때문에 정확히 어디로 옮길 것인가가 아닙니다. 내가 시도Swift, 특정 CGPoint에 애니메이션 적용
: translatesAutoresizingMaskIntoConstraints =
진정한는하지만 차이가 없습니다.나는이 시도했다 : 시뮬레이터에서 실행할 때
//Define screen sizes
let screenSize: CGRect = UIScreen.mainScreen().bounds
let screenWidth = screenSize.width
let screenHeight = screenSize.height
// Sizes of centre cards
let centreCardWidth = screenWidth/5
let centreCardHeight = (screenWidth/5)/0.625
let centralizeViewHorizontalCard = (screenWidth/2) - ((screenWidth/5)/2)
let centralizeViewVerticleCard = screenHeight/2
UIView.animateWithDuration(0.25, delay: 0.5, options: [], animations: {
centreCard3.frame = CGRectMake(centralizeViewHorizontalCard, centralizeViewVerticleCard, centreCard3.frame.size.width, centreCard3.frame.size.height)
}, completion: nil)
그러나 절대적으로 아무 일도하지 않습니다.
를 init이되고있다? – Chajmz
언제이 코드를 호출하고 어디서 왔습니까? – jrturton
에서 ViewDidLoad. – RufusV