uitabbar

iOS 10: Custom UITabBar background image produces border at top of image. How do I remove it?

戏子无情 提交于 2019-12-04 07:23:52
Anyone have a working solution to get rid of this border in iOS 10? I have a custom UITabBar background image. I've tried the following with no results: tabBar.backgroundImage = UIImage(named: "myBackgroundImage.png") tabBar.shadowImage = nil tabBar.shadowImage = UIImage() // i've also tried combinations of this in the storyboard directly I finally threw my hands up in the air and set the bar style to "Black".. this doesn't get rid of the border, but makes it white. So it hides it. If you use backgroundImage then shadow line will come so you can try this : self.tabBar.backgroundImage = UIImage

Tab bar not showing icons?

你说的曾经没有我的故事 提交于 2019-12-03 23:16:58
I read a bunch of related questions, I tried what they said, nothing works really. Not sure why. So, I have 3 different UIStoryboards . First one is the Auth Storyboard that handles Login/Register and there's a storyboard reference to the second Storyboard - Tab bar storyboard. This storyboard contains 5 other storyboard references that would load it's separate view controllers. My problem is that the icons are not showing once the user is logged in. I setup a custom color of the first view controller in the UITabViewController just to make sure it loads. It does. I've tried to setting all

iOS TabBar Image assignment

心不动则不痛 提交于 2019-12-03 21:50:41
If it is possible, how would you go about setting a custom image to each state (selected/not selected) of tab bar items. This would need to override the default behavior which blues the tab bar item image when selected and grays it when not selected. Thanks. To recolor tab bar item use - /* for colored tab items */ @interface UITabBar (ColorExtensions) - (void)recolorItemsWithColor:(UIColor *)color shadowColor:(UIColor *)shadowColor shadowOffset:(CGSize)shadowOffset shadowBlur:(CGFloat)shadowBlur; @end @interface UITabBarItem (Private) @property(retain, nonatomic) UIImage *selectedImage; -

How to refresh a tableView on click tabBar item Swift?

独自空忆成欢 提交于 2019-12-03 21:36:53
I have a tableView into a viewController on tab Bar. When I click into tabBar item the tableView isn't refreshing. But I have the viewWillAppear function: override func viewWillAppear(animated: Bool) { dispatch_async(dispatch_get_main_queue(), { () -> Void in self.tableView.reloadData() }) } I'm trying call this function with tab bar delegate, but not works: func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) { dispatch_async(dispatch_get_main_queue(), { () -> Void in self.tableView.reloadData() }) } Why not reload? Thanks! You do not need to involve the tab bar controller in this.

Preserving the original image color of the selected and unselected UITabBar icons

空扰寡人 提交于 2019-12-03 20:39:14
问题 The structure is the following: In my storyboard, I have a Tab Bar Controller which contains a Tab Bar object. This object has a custom class in which I have only this method: - (void)awakeFromNib { NSArray *imageNames = @[@"test1", @"test2", @"test3", @"test4", @"test5"]; for (int i=0; i<5; i++) { UITabBarItem *item = [self.items objectAtIndex:i]; NSString *imageName = [imageNames objectAtIndex:i]; item.image = [[UIImage imageNamed:imageName] imageWithRenderingMode

Completely transparent UITabBar in iOS 8

天大地大妈咪最大 提交于 2019-12-03 18:51:59
问题 I'm trying to make my tabBar transparent, I've searched but all I found was articles resulting in partly and not fully transparent tabBars and some were for IOS 5, etc. I would like to accomplish this as seen in Sketch 3: What's the easiest way to accomplish this? I thought of doing this: // Make the tabBar transparent self.tabBarController.tabBar.backgroundColor = [UIColor clearColor]; self.tabBarController.tabBar.translucent = YES; but that result wasn't exactly perfect: Really appreciate

How to apply a gradient on a UI Tab Bar In Swift?

不羁的心 提交于 2019-12-03 17:27:02
I built the tab bar through the storyboard, and to customise the colour I change it in the app delegate, with UITabBar.appearance().barTintColor = Color , I have a gradient method which is this: func setGradientBackground(colorOne: UIColor, colorTwo: UIColor) { let gradientlayer = CAGradientLayer() gradientlayer.frame = bounds gradientlayer.colors = [colorOne.cgColor, colorTwo.cgColor] gradientlayer.locations = [0, 1] gradientlayer.startPoint = CGPoint(x: 1.0, y: 0.0) gradientlayer.endPoint = CGPoint(x: 0.0, y: 0.0) layer.insertSublayer(gradientlayer, at: 0) } How do I apply this to the

How to prevent view resizing/transform when UINavigationBar hides/shows

让人想犯罪 __ 提交于 2019-12-03 15:08:00
I have an application with a tab bar and a navigation bar. I push a view controller that is used to show photos, one at a time. It initially shows the bars and forward/back controls; after a delay, these hide, using setNavigationBarHidden:animated: and a custom transform ( CGAffineTransformMakeTranslation ) on the tab bar. This works, but the view controllers view , which shows the photo, leaps up and down. The same is true if I leave the tab bar out of the equation. How can I prevent the UINavigationBar from moving my view around? I would like the photo to stay fixed in the screen, with the

How could I create a custom tabbar similar to this

删除回忆录丶 提交于 2019-12-03 13:40:43
问题 How could I create this custom tabbar and what does it consist of? 回答1: On cocoacontrols.com you can find several TabBar implementations similar to this. 回答2: iOS 5 now allows to change the background image of the tabbar but this kind of custom control is much more complex. You would basically need to write your own view and controller that would change between views, move the arrow accordingly and activate/deactivate the buttons. As of the elements it consists of, i would say One background

Selected state of tab bar icon in IOS 7

穿精又带淫゛_ 提交于 2019-12-03 13:04:13
问题 I'm having fun learning to build my first iPhone app and wonder if someone would kindly point me in the right direction. I have basically added in custom icons for my tab bar (IOS 7). Now I want to add in a custom selected state icon for each of these. How would I do this? Thanks Shell 回答1: As of Xcode 6, you can do this by default in Interface Builder. No need for any custom subclasses or categories as before. 回答2: Here is the swift solution based on @MrAlek's solution, create a custom