sử dụng đoạn mã sau trong các phụ huynh ViewController, tôi muốn trình bày một cái nhìn thứ hai ontop những người đầu tiên, sau đó sa thải đầu tiên:Làm thế nào để trình bày một ViewController thứ hai và loại bỏ các
// Animates the next questionViewController using the first questionViewController
[previousView presentViewController:nextQuestionViewController animated:YES completion:nil];
// Dismiss the first questionViewController
[previousView dismissViewControllerAnimated:NO completion:nil];
Khi chạy, các lần xem thứ hai được trình bày, nhưng chế độ xem đầu tiên sẽ không loại bỏ.
previousView là một viewController trên một bộ điều khiển chuyển hướng ngăn xếp hoặc nó được hiển thị modally? –
Có, nó được hiển thị một cách bình thường. Tôi không thể hiểu tại sao nó sẽ không bỏ qua. –
Từ mã của bạn, nó chỉ nói presentViewController: animated, not presentModalViewController: animated –