presentViewController ne recouvre pas toutes les vues

Bonsoir,



Au premier lancement de mon application (et aussi lorsque la configuration est initialisée), une vue est affichée pour relancer la configuration.



Nénmoins, j'ai rajouté une animation à  la tabbar de l'application (comme dans l'application twitter, une petite flèche qui indique quel tab est sélectionné), et cette flèche n'est pas recouverte par la nouvelle vue.



J'ai mis un screenshot (la flèche est visible en bas à  droite)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions<br />
{<br />
    <br />
    UIColor *greenColor = [UIColor colorWithRed:0.133 green:0.733 blue:0.129 alpha:1]; /* #22BB21 */<br />
<br />
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];<br />
    // Override point for customization after application launch.<br />
    profileViewController = [[ProfileViewController alloc] init];<br />
    statisticViewController = [[StatisticViewController alloc] init];<br />
    achievementViewController = [[AchievementViewController alloc] init];<br />
    SettingsViewController *vc3 = [[SettingsViewController alloc] init];<br />
    <br />
<br />
    tabBarController = [[UITabBarController alloc] init];<br />
    tabBarController.viewControllers = [NSArray arrayWithObjects:profileViewController, statisticViewController, achievementViewController, vc3, nil];<br />
    [tabBarController.tabBar setSelectedImageTintColor:greenColor];<br />
    <br />
    tabBarController.delegate = self;<br />
<br />
    [self.window addSubview:tabBarController.view];<br />
<br />
    _window.rootViewController = tabBarController;<br />
    <br />
    // ----&gt; ICI &lt;----<br />
    [self addTabBarArrow];<br />
    [self.window makeKeyAndVisible];<br />
    return YES;<br />
}




Et la méthode addTabBarArrow


- (void) addTabBarArrow {<br />
<br />
    UIImage* tabBarArrowImage = [UIImage imageNamed:@&quot;TabBarNipple.png&quot;];<br />
    self.tabBarArrow = [[UIImageView alloc] initWithImage:tabBarArrowImage];<br />
    // To get the vertical location we start at the bottom of the window, go up by height of the tab bar, go up again by the height of arrow and then come back down 2 pixels so the arrow is slightly on top of the tab bar.<br />
    CGFloat verticalLocation = self.window.frame.size.height - tabBarController.tabBar.frame.size.height - tabBarArrowImage.size.height + 2;<br />
    tabBarArrow.frame = CGRectMake([self horizontalLocationFor:0], verticalLocation, tabBarArrowImage.size.width, tabBarArrowImage.size.height);<br />
    <br />
    [self.window addSubview:tabBarArrow];<br />
}




Et l'endroit ou je fait le presentViewController :
- (void) viewDidAppear:(BOOL)animated {<br />
    <br />
    //Check if it&#39;s first lauch<br />
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];<br />
<br />
    if (&#33; [defaults boolForKey:@&quot;notFirstRun&quot;])<br />
    {<br />
	    [defaults setBool:YES forKey:@&quot;notFirstRun&quot;];<br />
	    <br />
	    FirstLaunchViewController *settings = [[FirstLaunchViewController alloc] init];<br />
	    [self presentViewController:settings animated:YES completion:nil];<br />
    }<br />
    <br />
    [self refreshUserInterface];<br />
}




Merci image/smile.png' class='bbc_emoticon' alt=':)' />

Réponses

  • Bon j'ai trouvé un workaround, j'ai rajouté une méthode removeTabBarArrow que j'appele à  l'affichage de ma vue, et j'appele addTabBarArrow quand c'est finit.
Connectez-vous ou Inscrivez-vous pour répondre.