欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

iOS 隐藏tabbar

程序员文章站 2022-10-31 15:02:23
-(void)viewwillappear:(bool)animated { nsarray *array=self.tabbarcontroller.view.subv...
-(void)viewwillappear:(bool)animated
{
    
    nsarray *array=self.tabbarcontroller.view.subviews;
    
    uiview *view=array[2];
    
    view.frame=cgrectmake(0, [uiscreen mainscreen ].bounds.size.height, [uiscreen mainscreen ].bounds.size.width, 49);
    
    [uiview commitanimations];
    
}

- (void)viewwilldisappear:(bool)animated
{
    
    nsarray *array=self.tabbarcontroller.view.subviews;
    
    uiview *view=array[2];
    
    view.frame=cgrectmake(0, [uiscreen mainscreen ].bounds.size.height-49, [uiscreen mainscreen ].bounds.size.width, 49);
    
    [uiview commitanimations];
}