Vì vậy, tôi đang cố gắng để tạo ra một hiệu ứng gạch lật, giống như trên Windows Phone 7.Lớp Chức vụ nhảy lúc bắt đầu (Core) Animation
Cho đến nay tôi đã đoạn mã sau, nhưng tôi có một vài truy vấn.
CALayer *layer = self.theRedSquare.layer;
CATransform3D initialTransform = self.theRedSquare.layer.transform;
initialTransform.m34 = 1.0/-1000;
[UIView beginAnimations:@"Scale" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
layer.transform = initialTransform;
layer.anchorPoint = CGPointMake(-0.3, 0.5);
CATransform3D rotationAndPerspectiveTransform = self.theRedSquare.layer.transform;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI , 0 , -self.theRedSquare.bounds.size.height/2, 0);
layer.transform = rotationAndPerspectiveTransform;
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
1. Tại sao hình vuông màu đỏ của tôi (một cái nhìn giao diện người dùng đơn giản) của tôi chuyển sang bên phải khi bắt đầu các hình ảnh động?
2. Đối với điểm neo, bạn có thể đặt vị trí trên chế độ xem gốc không? Tại thời điểm này tôi tự ý đặt nó tương ứng với chế độ xem hiện tại.
Cảm ơn trước cho bất kỳ con trỏ nào.
Trước khi hoạt hình
Trong phim hoạt hình (chú ý vuông đã chuyển ngay)
Sau hoạt hình (chú ý vuông đã chuyển bên phải)
Đã thêm video: example video
Thật tuyệt vời, cảm ơn! – JonB
Làm thế nào để bạn có được hoạt hình để tạo hiệu ứng động? (Flip trong đó) Tôi đã cố gắng hàng giờ để tìm ra điều này. – Frankrockz