Mã của tôi là dưới đây, nhưng các hình ảnh động chỉ xảy ra ngay lập tức ví dụ quan điểm là không còn có thể nhìn thấy:Issue hiệu ứng động với CATransform3DRotate
UIView *leftDoorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width /2, self.view.bounds.size.height)];
leftDoorView.backgroundColor = [UIColor greenColor];
leftDoorView.layer.anchorPoint = CGPointMake(0.0, 0.5);
[self.view addSubview:leftDoorView];
leftDoorView.center = CGPointMake(0.0, self.view.bounds.size.height/2.0); //compensate for anchor offset
CATransform3D transform = CATransform3DIdentity;
transform.m34 = -1.0f/500.0;
transform = CATransform3DRotate(transform, M_PI_2, 0, 1, 0);
[UIView animateWithDuration:1.0 animations:^{
leftDoorView.layer.transform = transform;
}];
Không chắc những gì tôi đang làm sai - bất kỳ trợ giúp sẽ được đánh giá cao xin vui lòng.
Tôi vừa sao chép mã của bạn vào chế độ xemDidAppear: của một ứng dụng và nó hiển thị hình động một cách chính xác. –