SORU
11 Mart 2011, Cuma


Nasıl uitabbarcontroller gizlemek için

UITabBarController bir problem var. Benim uygulamada, ben bastırdım değil saklanmak istiyorum, çünkü bunu gizlemek için ama hidesBottomBarWhenPushed kullanmadan istiyorum. Örneğin, bir uygulamam Gizle düğmesini bastığımda saklamak istiyorum.

Google birçok makale okudum ama yapamam.

CEVAP
11 Mart 2011, Cuma


Benim çalışma kodu bu yapıştırma duyuyorum... bu yöntemler ve tabbarcontroller gizlemek için arayabilirsiniz.... sadece pas tabbarcontroller bu fonksiyonlara örnek..

// Method call
[self hideTabBar:self.tabBarController];   

// Method implementations
- (void)hideTabBar:(UITabBarController *) tabbarcontroller
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];

    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
        }
    }

    [UIView commitAnimations];   
}

- (void)showTabBar:(UITabBarController *) tabbarcontroller
{       
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        NSLog(@"%@", view);

        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];

        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
        }
    }

    [UIView commitAnimations]; 
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • K-391

    K-391

    23 EKİM 2012
  • Tahir Jahi

    Tahir Jahi

    6 Mart 2006
  • ThePhestor

    ThePhestor

    22 Mart 2011