【问题标题】:hide tabbar-issue隐藏标签栏问题
【发布时间】:2011-01-14 07:13:50
【问题描述】:

我有基于标签栏的应用程序..

在我的 TabBar 应用程序中,我想在第二个视图出现时隐藏标签栏。在我的第二个视图中,imageView 具有该视图的完整空间 (320*367)

CGRect imageframe = CGRectMake(0,0,320,367);

imageView = [[UIImageView alloc] initWithFrame:imageframe];

但我不想使用self.hidesBottomBarWhenPushed = YES;

当我使用此代码时 self.tabBarController.tabBar.hidden = YES;它隐藏了标签栏,并且在标签栏空间中显示了一个空白区域..

在这里,我想隐藏标签栏没有空白的标签栏空间(即,我想在标签栏隐藏时调整图像视图的大小)

【问题讨论】:

    标签: iphone hidden tabbar


    【解决方案1】:

    在视图将出现第二个视图调整 imageView 框架的大小。

     CGRectFreme imageFrame=self.yourImageView.Frame;
    
      imageFrame.size.hieght +=50//or what you want
    
      self.yourImageView.Frame=imageFrame;
    

    并像往常一样使用 self.hidesTabBarWhenPushed 隐藏 tabBar。

    【讨论】:

      【解决方案2】:

      您可以模态地展示您的视图控制器:

      MyImageViewController *imv = [[MyImageViewController alloc] initWithNibName:@"MyImageViewNib" bundle:nil];];
      imv.setSomeProperty = @"image.jpg";
      [self presentModalViewController:imv animated:NO];
      [imv release];
      

      【讨论】:

        【解决方案3】:

        不确定默认的自动掩码设置为什么。

        但你可以尝试设置 autoresizingMask:

        imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2018-02-24
          • 1970-01-01
          • 2015-05-09
          • 1970-01-01
          • 2013-02-24
          • 2013-09-21
          • 1970-01-01
          相关资源
          最近更新 更多