Tag: uitabbar

隐藏标签栏并删除空间

有没有办法隐藏tabbar和删除剩下的空间(约50px)? 我试过了 self.tabBarController?.tabBar.hidden = true self.extendedLayoutIncludesOpaqueBars = true 没有运气。 我看到空白。

iOS5 TabBar字体和颜色

我已经定制了TabBar外观 UIImage *tabBackground = [[UIImage imageNamed:@"tab-bar-bg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UITabBar appearance] setBackgroundImage:tabBackground]; [[UITabBar appearance] setSelectionIndicatorImage: [UIImage imageNamed:@"activetab.png"]]; 如何定义自定义字体以及选定和未选中的文字颜色? 谢谢,

要更改iOS 7中未select的UITabBar图标的颜色?

我知道这个问题早就被问到了,但是我仍然没有在互联网上find解决scheme。 我提到了以下几个职位: 如何更改iOS 7中tabBarItems的文本和图标颜色? 只能使用tintColor更改选定的图标颜色。 如何更改iOS 7中未选中的标签栏项目的颜色? 在这里他们写了自己从UIViewinheritance的GozTabBar类 当它处于未选中状态时,我想更改UITabBar图标的默认灰色。 任何帮助将不胜感激。 提前致谢。

显示和解除视图控制器后,iOS 7.1上的选项卡栏背景缺失

我在iOS 7.1上试过我的应用程序,发现标签栏背景在几次消失。 我能够追查他们; 它发生在: 推动视图控制器放置在导航控制器(这是在标签栏控制器内)与hidesBottomBarWhenPushed = YES 呈现一个视图控制器,然后解散它(即MFMailComposeViewController ) 我创build了一个示例应用程序(使用标签栏模板+添加button来显示视图控制器,和一个mapView能够告诉如果酒吧消失),问题在那里。 以下是我更改的示例应用程序的所有代码: #import "FirstViewController.h" @import MessageUI; @interface FirstViewController () <MFMailComposeViewControllerDelegate> @end @implementation FirstViewController – (IBAction)presentVCButtonPressed:(id)sender { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; [mailer setSubject:@"Feedback for Routie"]; [mailer setToRecipients:@[@"support@routieapp.com"]]; [self presentViewController:mailer animated:YES completion:nil]; } } – (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError […]

在Swift中设置活动标签栏项目的背景颜色

如果可能的话,我希望能够在不使用图像的情况下完成这个任务。 有没有办法以编程方式创build图像中显示的效果,而不必将每个选项卡呈现为图像? 每个我在SO上看过的问题都将标签保存为JPG格式,这比我觉得应该是更多的工作。 有任何想法吗?

更改标签栏项目图像和文本颜色的iOS

这是我的标签栏: 下图显示正在运行的程序和所选的“新闻”项目: 很明显,酒吧的色调工作正常,因为我想! 但tintColor只影响图像,而不是文字。 此外,当一个项目被选中(如上所示,新闻)项目的颜色变蓝! 我如何防止这种情况发生? 我希望它保持白色。 为什么select时文本会变成白色,而不是当它被取消时变成白色? 我基本上希望项目的颜色和文字颜色一直是白色的。 我如何做到这一点? 谢谢你的帮助。 它是否需要每个单独项目的快速代码? 编辑:

第二个视图中的Tabbar

我在我的应用程序中有一个激活页面,每个用户都必须激活该应用程序。 一旦应用程序被激活,用户移动到标签栏视图。 我创build了一个标签栏应用程序,从我的activationView上点击button我试图调用标签栏,我得到一个完整的黑屏。 – (IBAction)moveToActivateView:(id)sender { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; UITabBarController *tabBarController = [[UITabBarController alloc]init]; [self.view addSubview:tabBarController.view]; appDelegate.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; self.tabBarController.viewControllers = @[viewController1, viewController2]; appDelegate.window.rootViewController = self.tabBarController; [appDelegate.window makeKeyAndVisible];}

iOS 11 UIBarButtonItem图片没有resize

我的问题的答案暗示在这个问题 ,所以我想答案是禁用我的UIToolbar视图的自动布局。 据说为视图工作的代码是 cButton.translatesAutoresizingMaskIntoConstraints = YES; 但我不知道它是否适用于我的代码,因为UIToolbar不从UIViewinheritance。 我在游戏中使用了很多小图片,这些图片的尺寸取决于设备和方向。 当苹果推出新设备时,我决定先制作一张160×160的图像,然后在使用时重新resize,而不是添加许多不同的图像。 这从iOS 4 – iOS 10很好,但在iOS 11失败。 代码非常简单: // Get the image NSString *pictFile = [[NSBundle mainBundle] pathForResource:@"Correct" ofType:@"png"]; UIImage *imageToDisplay = [UIImage imageWithContentsOfFile:pictFile]; UIImage *cImage = [UIImage imageWithCGImage:imageToDisplay.CGImage scale:[UIScreen mainScreen].scale orientation:imageToDisplay.imageOrientation]; UIButton *cButton = [UIButton buttonWithType:UIButtonTypeCustom]; [cButton setImage:cImage forState:UIControlStateNormal]; [cButton setTitle:@"c" forState:UIControlStateNormal]; //set the frame of […]

是否有可能更改UITabBarItem徽章的颜色

我想更改UITabBarItem 徽章的背景颜色,但找不到任何资源如何使它。

标签栏上的自定义button变圆

这是我正在做的事情: 注意:截图取自iOS的早期版本 我所能达到的: 码: override func viewWillAppear(animated: Bool) { // Creates image of the Button let imageCameraButton: UIImage! = UIImage(named: "cameraIcon") // Creates a Button let cameraButton = UIButton(type: .Custom) // Sets width and height to the Button cameraButton.frame = CGRectMake(0.0, 0.0, imageCameraButton.size.width, imageCameraButton.size.height); // Sets image to the Button cameraButton.setBackgroundImage(imageCameraButton, forState: .Normal) // Sets […]