Tag: uitabbaritem

从UITabBarItem中删除渐变/光泽

我正在自定义UITabBar 。 我在UITabBarItem使用了我的自定义图像。 问题是该项目是否有渐变/光泽。 我检查了苹果的应用程序商店没有任何对其UITabBarItem的这种光泽效果。 我如何从UITabBarItem删除渐变?

在UITabBarItem中标题文字拥抱/字距+裁剪

我有这样的UITabBarController : 正如你所看到的,“发现”和“请求”标题被大量的字距压缩。 在每个项目标题的末尾,它们也被略微裁剪。 有没有什么办法解决这一问题? PS此问题在iPhone 6和6+上不出现,只有5S及以下。

我不能将标题设置为我的编程标签栏控制器

我尝试以编程方式创build标签栏控制器。 这是好的,但我不能设置标题栏标签项目..我怎么能做到这一点? – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. myTabBarController = [[UITabBarController alloc] init]; tab1 = [[ZiyaretFormTab1 alloc] initWithNibName:@"ZiyaretFormTab1" bundle:nil]; tab2 = [[ZiyaretFormTab2 alloc] initWithNibName:@"ZiyaretFormTab2" bundle:nil]; tab3 = [[ZiyaretFormTab3 alloc] initWithNibName:@"ZiyaretFormTab3" bundle:nil]; tab4 = [[ZiyaretFormTab4 alloc] initWithNibName:@"ZiyaretFormTab4" bundle:nil]; tab5 = [[ZiyaretFormTab5 alloc] initWithNibName:@"ZiyaretFormTab5" bundle:nil]; UITabBarItem […]

如何在iPhone SDK中显示tabbar图标全尺寸?

如何在这个图像中显示完整大小的tabbar图像图标,你可以看到。 这是我的形象,你不能看到图像将是不完美的 如何显示我的形象看起来像上面的图像显示我已经用于显示图像这个代码navigationController2.tabBarItem.image = [UIImage imageNamed:@"camera_btn"]; 嘿,我已经find了解决scheme,但我不知道如何更改tabbar控制器视图,我不能让我的相机button,就像他们在这里我正在创build像这样的AppDelegate.m文件的tabbar控制器 self.tabbarController = [[[UITabBarController alloc] init] autorelease]; self.tabbarController.viewControllers = [NSArray arrayWithObjects:navigationController1, navigationController2, navigationController3, nil]; 这给我输出第二个图像,我已经显示,但从例子和我从这里看到的代码, 提高了标签栏图标 我必须使用这个代码,但它并没有给我确切的结果,因为我想,我认为这是不会改变的意见也请帮助我。 self.tabbarController.viewControllers = [NSArray arrayWithObjects: [self viewControllerWithTabTitle:@"Feed" image:[UIImage imageNamed:@"112-group.png"]], [self viewControllerWithTabTitle:@"Popular" image:[UIImage imageNamed:@"29-heart.png"]], [self viewControllerWithTabTitle:@"Share" image:nil], [self viewControllerWithTabTitle:@"News" image:[UIImage imageNamed:@"news.png"]], [self viewControllerWithTabTitle:@"@user" image:[UIImage imageNamed:@"123-id-card.png"]], nil]; 我还添加了这个代码来创buildappdelegate.m中的中心button -(void)willAppearIn:(UIWindow *)navigationController { [self addCenterButtonWithImage:[UIImage imageNamed:@"cameraTabBarItem.png"] highlightImage:nil]; […]

UITabBarItem更改图像的高度和宽度

我有一个UITabBarItem没有标题,只有一个图像。 我想知道如何改变图像大小,以便占用整个UITabBarItem。 我在互联网上search,但没有发现任何东西。 我试过了: UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main_Storyboard" bundle:nil]; UITabBarController *tabBarController = [storyBoard instantiateViewControllerWithIdentifier:@"tab"]; UITabBar *tabBar = tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1]; UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2]; tabBarItem1.imageInsets = UIEdgeInsetsMake(0, -10, -6, -10); 但没有任何改变。 谢谢!

如何在Swift 3中更改TabBar中禁用的项目颜色?

我有一个TabBar在我的项目,当用户select项目将禁用,但颜色也将改变! 我想要的颜色与其他项目颜色相同,我用TabBar item.isEnabled = false 禁用项目,但此代码在这里不适用于此项目 override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.tabBar.barTintColor = UIColor.init(red: 126/255, green: 0/255, blue: 64/255, alpha: 1.0) if #available(iOS 10.0, *) { self.tabBar.unselectedItemTintColor = UIColor.white self.tabBar.unselectedItemTintColor = UIColor.white } else { // Fallback on earlier versions } UITabBar.appearance().tintColor = UIColor.white }

如何在代码中设置UITabBar中选定的项目?

我在我的应用程序中实现UITabBar 。 我pipe理通过在我的头文件中实现UITabBarDelegate并使用它 – (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item 在我的.m文件(如本教程中所述 )。 现在,我的应用程序中有3个场景,我希望从代码中手动设置所选的UITabBarItem (而不是基于用户操作): 一旦viewDidLoad didReceiveMemoryWarning 在某些情况下,当用户正在进入另一个视图控制器 – 当他们回来,他们应该回到不同的标签,他们点击。 任何人都可以指导我如何做到这一点?

UITabBar徽章在iOS7中的位置

有无论如何定位UITabBar徽章? 它在iOS7中看起来没有什么变化。 在iOS7中,它向下一个标签栏项目移动。 我已经使用了一个自定义标签栏项目。 UINavigationController *navController = [self.viewControllers objectAtIndex: 0]; UIViewController *viewController = [navController.viewControllers objectAtIndex:0]; CustomTabBarItem *tabBarItem = [[CustomTabBarItem alloc] initWithTitle:EMPTY_STRING image: nil tag:2]; [tabBarItem setImageInsets:UIEdgeInsetsMake(-14.5, 0, 14.5, 0)]; tabBarItem.customHighlightedImage= [UIImage imageNamed: @"icon_on.png"]; tabBarItem.customStdImage = [UIImage imageNamed:@"icon_off.png"]; viewController.tabBarItem = tabBarItem;

大小错误setSelectionIndicatorImage

美好的一天! 我把一个图片放在标签栏中,但是它的大小不正确。 帮我解决问题。我想填写整个项目。 + (void)setupTabBarAppearance { [[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:30.0f/255.0f green:201.0f/255.0f blue:224.0f/255.0f alpha:1]]; UIImage *image = [[self imageWithColor:[UIColor colorWithRed:255.0f/255.0f green:198.0f/255.0f blue:25.0f/255.0f alpha:1]] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 1, 2) resizingMode:UIImageResizingModeStretch]; [[UITabBar appearance] setSelectionIndicatorImage:image]; }

UITabBarItem标题的中心标题,而不是底部

我想让位于项目中心的tabbaritem.title,这可能吗? 我正在尝试用中间的文字制作图像,并创build自定义的tabbaritem,但看起来很糟糕,请帮我。