Trong iOS 5 nó chạy một cách chính xác:Lỗi để trình bày quan điểm điều khiển trung vào iPad iOS 6
PinRequiredViewController *pinView = [[PinRequiredViewController alloc]initWithNibName:@"PinRequiredView" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pinView];
// show the navigation controller modally
navController.modalPresentationStyle = UIModalPresentationFormSheet;
navController.modalInPopover = NO;
navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:navController animated:YES completion:nil];
navController.view.superview.frame = CGRectMake(0, 0, 250, 250);
navController.view.superview.center = self.view.window.center;
Nhưng không phải làm việc tốt trong iOS6, quan điểm không ở lại tập trung ở màn hình, cả hai bức chân dung và phong cảnh. Bất kỳ giải pháp nào?
Cảm ơn !! :)
Tôi có cùng một vấn đề và không thể giải quyết được. Được sử dụng để hoạt động tốt trước iOS 6. –
@ Javi_576 Chính xác vấn đề ở đây là gì? Các câu hỏi nói "không hoạt động" không phải là mô tả kỹ lưỡng về vấn đề này. Bạn đang nói rằng nó không có mặt? –
Không, chế độ xem được căn giữa trong iOS5 với mã này, nhưng không có trong iOS6. –