Tag: uitabbarcontroller

没有UITabBar的UITabBarController

我试图从UITabBarController中隐藏/删除UITabBar。 我的iPhone版本中有一个UITabBar,但是我已经将导航移到了iPad版本的新视图控制器中。 新菜单使用UITabBarDelegate方法在UIViewControllers之间切换。 到现在为止还挺好。 我现在需要的是以某种方式隐藏UITabBar。 我有一个自定义的UITabBarController,我试着简单地使用self.tabBar.hidden = YES; 但我需要视图来填充屏幕。 谢谢

UITabBarItem上的自定义背景未在第二次敲击时设置

我有一个自定义的标签栏与自定义的标签栏项目。 一切工作,因为我想要的,除了当一个水龙头已点击,并处于选定的状态,它不会使用我自定义突出显示的背景,如果重新点击。 到目前为止,我设定: UIButton *tap = [UIButton buttonWithType:UIButtonTypeCustom]; [tap setBackgroundImage:img forState:UIControlStateNormal]; [tap setBackgroundImage:[UIImage imageNamed:@"img_down"] forState:UIControlStateHighlighted]; [tap setBackgroundImage:[UIImage imageNamed:@"img_down"] forState:UIControlStateSelected]; 我读过,我可能需要使用UITabBarDelegate。 有任何想法吗?

无法停止设备旋转

我在这里发布了一个问题。 其中一个好友回答并给出了解决办法。 虽然这个解决scheme在很less的视图控制器上工作,但是看起来不行。 当我进入一个视图控制器的TabController +导航控制器的那里标签栏项目,代码不起作用。 和意见是能够旋转。 我使用iOS 6.1的以下代码 //For iOS6 – (BOOL)shouldAutorotate { return NO; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationPortrait; } – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } 我也必须在iOS 7中实现同样的东西。 请帮忙

Tableview最后一行在tabbarcontroller下被切断

我有一个Tabbarcontroller,在第一个tabview我有一个tableviewcontroller。 现在最后一行是一半可见,其余的是在tabbarcontroller下。 我没有检查我的TabBar控制器的界面生成器中的扩展边缘,但没有任何更改。 我也在我的tableview控制器中试过这个: self.edgesForExtendedLayout = UIRectEdgeNone; 但是最后一行仍然是tabbar的一半。 有人知道我怎么能解决这个问题?

当hidesBottomBarWhenPushed仅在iOS7上设置为YES时,UITabBarController子视图消失

我做了一个UITabBarController的子类,在选项卡顶部添加一个自定义UIView,以replaceUITabBarItem上的默认标记。 我在自定义的UITabBarController的viewDidLoad上添加了这些自定义的badgeviews。 [self.view addSubview:_tabBarItem1BadgeView]; 我的自定义tabBarBadgeView上的drawRect如下所示: – (void)drawRect:(CGRect)rect{ CGContextRef ctx = UIGraphicsGetCurrentContext(); // Badge CGSize size = self.frame.size; CGSize badgeSize = [self sizeThatFits:size]; badgeSize.height = fminf(badgeSize.height, size.height); CGFloat x = roundf((size.width – badgeSize.width) / 2.0f); CGRect badgeRect = CGRectMake(x, roundf((size.height – badgeSize.height) / 2.0f), badgeSize.width, badgeSize.height); CGContextAddEllipseInRect(ctx, rect); CGContextSetFillColor(ctx, CGColorGetComponents([_badgeColor CGColor])); CGContextFillPath(ctx); [_textLabel drawTextInRect:badgeRect]; } 很好用。 […]

加载一些视图时如何隐藏UITabBarView?

我正在开发一个iPhone应用程序,我有一个UITabBarController,每个TabBarItem有一个UINavigationController。 我希望在一定程度的导航之后隐藏TabBar,并将其replace为全屏视图,就像iPod应用程序一样,TabBar在到达媒体播放器时隐藏起来,在返回到播放列表时返回,或者随你。 任何帮助或想法是高度赞赏

UITabBarController – 更多button不显示

我以编程方式创build我的TabBarController ,因为我想在每个选项卡中显示不同的内容相同的控制器。 内容由一个ID获取。 我使用的故事板ID与使用initWithNibName:相同的方式。 我在AppDelegate中这样做: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; UITabBarController *tabBarController = [[UITabBarController alloc] init]; for (int i = 0; i < 7; i++) { MyViewController *svc = [storyboard instantiateViewControllerWithIdentifier:@"MyView"]; [svc setID: i]; [tabBarController addChildViewController:svc]; } [self.window makeKeyAndVisible]; [self.window setRootViewController: tabBarController]; return YES; } 但TabBar只显示了7个Tab中的5个。 这很好,因为只有5个选项卡可以同时显示。 不幸的是…更多的button是不可见的。 […]

一起使用笔尖和故事板

从我在互联网上阅读的内容来看,笔尖和故事板在同一个项目中可以相互比较。 现在我正在创build一个选项卡式应用程序,并希望执行以下操作: 表1:用笔尖build造, 表2:用故事板构build, 表3:用笔尖构build 最初我用nib创build了所有东西,所以在我的委托中,我使用下面的代码从一个选项卡传递给下一个选项卡: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. UIViewController *viewController1, *viewController2, *viewController3; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController_iPhone" bundle:nil] autorelease]; viewController2 = [[[SecondViewController alloc] initWithNibName:@"SecondViewController_iPhone" bundle:nil] autorelease]; viewController3 = […]

UITabBar在顶部或其他?

我是新来的swift,将创build一个用户界面,其中显示一个tabor,当我通过苹果的人机界面的指导方针 ,他们说,不使用UITabBar顶部。 我们可以通过自定义来使用它,但是很多人在App Store中提交时会被拒绝。 所以,而不是UITabar应该使用顶部的标签?

TabBar上的图像不能正确显示..在顶部显示一个额外的行 – UPDATED

我已经添加了一个ImageView作为我的TabBar(有三个NavigationControllers)的子视图。 当我点击tabBarController的任何选项卡,然后imageView上的图像相应地改变(图像显示特定的选项卡和其他人未选中)。 但是,图像总是在tabBar上显示额外的行。 它看起来像跨越了tabBar的限制。 我的图像尺寸是320×64像素(非视网膜iPhone)和640×128像素(视网膜iPhone)。 以下是我如何声明图像视图和tabBarController的实例var。 @interface HomePageViewController ()<UITabBarControllerDelegate> { UIImageView* tabBarView; UITabBarController *tabBarController; } -(UITabBarController *) configureTheTabBarControllerWithNavControllerAtIndex:(NSInteger)index { UINavigationController *customerCareNavController; UINavigationController *accAndContactsNavController; UINavigationController *purchaseOrderNavController; CustomerCareViewController *custCareVC; PurchaeOrderViewController *POController; AccountsAndContactsViewController *accAndContactsController; custCareVC = [[CustomerCareViewController alloc] initWithNibName:@"CustomerCareViewController_iPhone" bundle:NULL]; POController = [[PurchaeOrderViewController alloc] initWithNibName:@"PurchaeOrderViewController_iPhone" bundle:NULL]; accAndContactsController = [[AccountsAndContactsViewController alloc] initWithNibName:@"AccountsAndContactsViewController_iPhone" bundle:NULL]; customerCareNavController = [[UINavigationController alloc] initWithRootViewController:custCareVC]; purchaseOrderNavController […]