Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 隐藏iPhone中的选项卡栏问题?_Ios_Iphone - Fatal编程技术网

Ios 隐藏iPhone中的选项卡栏问题?

Ios 隐藏iPhone中的选项卡栏问题?,ios,iphone,Ios,Iphone,我在隐藏底部UtiAbar控制器时遇到问题。我使用以下代码来隐藏 UITabBar *tabBar = self.tabBarController.tabBar; UIView *parent = tabBar.superview; UIView *content = [parent.subviews objectAtIndex:0]; UIView *window = parent.superview; [UIView animateWithDuration:0.5

我在隐藏底部UtiAbar控制器时遇到问题。我使用以下代码来隐藏

 UITabBar *tabBar = self.tabBarController.tabBar;
UIView *parent = tabBar.superview;
UIView *content = [parent.subviews objectAtIndex:0];
UIView *window = parent.superview;

[UIView animateWithDuration:0.5
                 animations:^{
                     CGRect tabFrame = tabBar.frame;
                     tabFrame.origin.y = CGRectGetMaxY(window.bounds);
                     tabBar.frame = tabFrame;
                     content.frame = window.bounds;
                 }];
工作正常。但在主视图中,我有一个按钮,用户单击该按钮,它将打开模态视图控制器作为弹出对话框。取消弹出对话框后,将出现以下屏幕


选择要隐藏其选项卡栏的视图控制器,并选中“按下时隐藏底部栏”。
是的,我解决了我的问题

- (void)viewWillAppear:(BOOL)animated
{

}


当我使用上面的代码时,它将完美地工作:):):)

您是否在您的应用程序中使用navigationcontrollerapp@CharanGiri是的,我也是导航控制器。请给我那个问题的解决方案。我真的很期待你们是否面临状态栏的问题??状态栏是否重叠??在您的第一个屏幕中,它将不起作用,因为该属性就像您导航到任何屏幕时,它将隐藏选项卡ID,然后删除您以前的代码(您发布的代码)?因为它对我来说很好。不,我想使用此代码,因为当用户单击选项卡栏项目时,我想隐藏底部的选项卡栏。所以只有我不能删除我的代码
// Get the size of the main screen
CGRect fullScreenRect = [[UIScreen mainScreen]bounds];

// Hide the tab bar
((UITabBarController *)self.parentViewController).tabBar.hidden = YES;

// Resize and fill the screen
[[((UITabBarController *)self.parentViewController).view.subviews objectAtIndex:0] setFrame:fullScreenRect];
- (void)viewWillDisappear:(BOOL)animated
{

    ((UITabBarController *)self.parentViewController).tabBar.hidden = NO;

}