2013-10-04 21 views
5

Şu anda, bir düğmenin tıklatıldığı zaman, bir UIModalPresentationSheet gelir. Kaydığında, bunun üstünde bir gezinti çubuğu eklemek istiyorum. Çok fazla şey denedim ama hiçbir şey işe yaramıyor gibi görünüyor. İşte şu an çalıştığım şey bu hatayı döndürüyor.Model görünümünde gezinme denetleyicisi

AthleteAdd *addAthlete = [self.storyboard instantiateViewControllerWithIdentifier:@"addAthlete"]; 
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addAthlete]; 
    //[self.navigationController pushViewController:addAthlete animated:YES]; 

    addAthlete.delegate = self; 
    addAthlete.modalPresentationStyle = UIModalPresentationFormSheet; 
    // UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addAthlete]; 
    [self presentViewController:navigationController animated:YES completion:nil]; 

Ama modally yukarı iter ve modalpresentationsheet formu olmadan. Navigasyon kontrol cihazının doğru şekilde boyutlandırılmasını nasıl sağlayabilirim?

cevap

12

deneyin böyle kodunuzu değiştirmek için:

AthleteAdd *addAthlete = [self.storyboard instantiateViewControllerWithIdentifier:@"addAthlete"]; 
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addAthlete]; 

    addAthlete.delegate = self; 
    navigationController.modalPresentationStyle = UIModalPresentationFormSheet; 


    [self presentViewController:navigationController animated:YES completion:nil]; 

burada olduğundan, kendisinden addAthlete sunmaya çalıştık. Yani bu hatayı aldınız.

+0

Bu çalışır, ancak artık bir modalsheetpresentation olduğunu .. –

+0

benim düzenlemeye göz;) –

4

addAthlete öğesini kaydettiğiniz navigationController öğesini sunmalısınız.

[self presentViewController:navigationController animated:YES completion:nil]; 
0

Geçerli denetleyiciden kendisini gösteriyorsunuz.

gibi bir şey deneyin,

[self dismissViewControllerAnimated:YES completion:^{ 
    [self.parentViewController presentViewController: navigationController animated:YES completion:nil]; 
}]; 
İlgili konular