【问题标题】:iPhone Sub Tabs - NavigationiPhone 子标签 - 导航
【发布时间】:2012-10-18 21:21:55
【问题描述】:

我正在为 iPhone 应用程序设计 UI,我们将在底部有一个标准的 4 标签栏。我们正在考虑以上下文的方式使用相同的标签栏,这样当您点击搜索结果时,底部的选项将更改为与所按下的项目相关。

这种做事方式是否代表了一个巨大的可用性问题,或者如果我们在执行上保持一致就可以这样做?

screen1 底部标签导航:A B C D:

-点击搜索结果

-新页面以结果的详细视图为重点

screen2 底部标签导航:E F G H:

【问题讨论】:

    标签: iphone design-patterns user-interface tabs


    【解决方案1】:

    不可能在同一个 tabBar 上这样做,您可以隐藏 tabBar 并显示另一个带有所需项目的 tabBar,您可以使用以下方法隐藏/显示 tabBar:

    - (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]; 
    }
    

    您可以像这样使用这些方法:

    [self hideTabBar:self.tabBarController];
    [self showTabBar:self.tabBarController];
    

    当隐藏 tabBar 时,启动一个新的 tabBar 并将其添加到视图中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-22
      • 2011-01-09
      相关资源
      最近更新 更多