iphone uitableview uitabbarcontroller tabbar

iphone - ¿Es posible ocultar la barra de pestañas cuando se presiona un botón para permitir una visualización a pantalla completa del contenido?



uitableview uitabbarcontroller (6)

Tengo una UITabBar en la vista detallada de mi aplicación basada en navegación. Estoy almacenando texto e imágenes en una vista de tabla y me gustaría que el usuario pueda tocar una celda para ocultar el controlador de navegación y la barra de pestañas para ver el contenido en pantalla completa.

Encontré este código para ocultar las barras superiores, pero no parece tan fácil ocultar la barra de pestañas.

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; [self.navigationController setNavigationBarHidden:YES animated:YES];

¿Alguien sabe como hacer esto?

Este código no funciona para ocultar el tabBar una vez que la vista ya está cargada.

yourTabViewController.hidesBottomBarWhenPushed = YES;

Este es el código que encontré. Sin embargo, parece que solo funciona cuando se carga la vista, por lo que no se puede usar para ocultar la barra de pestañas una vez que ya ha aparecido. Todavía estoy luchando para hacer que esto funcione. ¡¡¡Por favor ayuda!!!

self.tabBarController.tabBar.hidden = YES;


En caso de que alguien necesite la versión MonoTouch para este pequeño truco. (¡Gracias!)

// Method implementations static void hideTabBar (UITabBarController tabbarcontroller) { UIView.Animate(0.4, delegate() { foreach(UIView view in tabbarcontroller.View.Subviews) { if(view.GetType()==typeof(UITabBar)) view.Frame=new RectangleF(view.Frame.X, 480, view.Frame.Size.Width, view.Frame.Size.Height); else view.Frame=new RectangleF(view.Frame.X, view.Frame.Y, view.Frame.Size.Width, 480); } }); } static void showTabBar (UITabBarController tabbarcontroller) { UIView.Animate(0.4, delegate() { foreach(UIView view in tabbarcontroller.View.Subviews) { if(view.GetType()==typeof(UITabBar)) view.Frame=new RectangleF(view.Frame.X, 367, view.Frame.Size.Width, view.Frame.Size.Height); else view.Frame=new RectangleF(view.Frame.X, view.Frame.Y, view.Frame.Size.Width, 367); } }); }


Hay una forma integrada de hacer esto:

self.hidesBottomBarWhenPushed = YES;

Pero tienes que hacer esto ANTES de que se empuje la vista. Así es como podrías usar eso:

ChildViewController* childVC = [[ChildViewController alloc] init]; childVC.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController:childVC animated:YES]; [childVC release];


He encontrado una respuesta a este problema, es muy simple y eficaz.

La solución es configurar la opción "Ocultar barra inferior en Push" en TODAS LAS VISTAS, VER CONTROLADORES y CONTROLADORES DE TAB BAR de su aplicación.

Puedes hacer esto en IB o por código de todos modos.

Espero que esto ayude a todos ...


La mejor solución que he encontrado es cambiar el tamaño de la vista para que cubra la barra de pestañas. Aquí está mi código para ocultar statusBar, navBar y tabBar cuando se selecciona una fila:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; if (appDelegate.navigationController.navigationBar.hidden == NO) { [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; [appDelegate.navigationController setNavigationBarHidden:YES animated:YES]; [UIView beginAnimations:@"HideTabbar" context:nil]; [UIView setAnimationDuration:.2]; self.view.frame = CGRectMake(0,0,320,480); [UIView commitAnimations]; } if (appDelegate.navigationController.navigationBar.hidden == YES) { [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; [appDelegate.navigationController setNavigationBarHidden:NO animated:YES]; [UIView beginAnimations:@"ShowTabbar" context:nil]; [UIView setAnimationDuration:.2]; self.view.frame = CGRectMake(0,0,320,368); [UIView commitAnimations]; } }


Mi solución:

// Hide tab bar animated CATransition *animation = [CATransition animation]; [animation setType:kCATransitionFade]; [[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; [self.tabBarController.tabBar setHidden:YES]; // Display tab bar animated CATransition *animation = [CATransition animation]; [animation setType:kCATransitionFade]; [[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; [self.tabBarController.tabBar setHidden:NO];

Tiene que agregar #import <QuartzCore/QuartzCore.h>


Para ajustar el tamaño de su ventana, primero debe seleccionar la opción NINGUNO en el campo de la barra de estado, debajo de la pestaña Atributos, de su ventana de Inspector. Entonces, Interface Builder te permitirá cambiar el tamaño de tu ventana.