- (void)showTabbar:(UITabBarController *)tabbarcontroller {
for(UIView *view in tabbarcontroller.view.subviews)
{
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)];
}
}
}
- (void)hideTabbar:(UITabBarController *)tabbarcontroller {
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)];
}
}
}
- (void)deleteTabbar:(UITabBarController *)tabbarcontroller {
[self.view removeFromSuperview];
NSMutableArray * vcs = [NSMutableArray
arrayWithArray:[self.tabBarController viewControllers]];
[vcs removeObjectAtIndex:5];
[self.tabBarController setViewControllers:vcs];
}
실제 버튼에 다음과 같은 명령을 적용하면 된다.
-(IBAction)go:(id)sender{//주일설교
self.tabBarController.selectedIndex = 1;
[self showTabbar:self.tabBarController];
[self deleteTabbar:self.tabBarController];
}
댓글 달기