uitabbaritem

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

How to move title of UITabBarItem?

半城伤御伤魂 提交于 2019-12-03 10:56:05
Can somebody tell me please how can I move title of UITabBarItem for example 2px to top? Solution: UITabBarItem *item = [tabBar.items objectAtIndex:0]; item.titlePositionAdjustment = UIOffsetMake(0, -5.0); Ibrahim Update for Swift 3 Put this code inside UITabBarController : UITabBarItem.appearance().titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -5) Credit goes to Tim Brown Swift 4 Like me, if you are creating tab bar controller inside some other controller just after adding all controller you can loop through the tab bar items and change title and positioning and font for (index

Where can I find custom UITabBarSystemItem icons?

会有一股神秘感。 提交于 2019-12-03 08:28:28
Is there a resource out there some place that has custom UITabBarSystemItem icons that others can use. I know you get some from Apple to start, but I would imagine there are a lot more that are very common. I don't see a reason for each person to recreate the wheel for things like home, settings, etc... Check out IconFinder . They have a very robust collection, and you can sort by image size. though these are not always perfect for the TabBar, you can find some good generic icons. You can also filter by license to find icons that are available for commercial use. Here is a list of some great

iOS : How to add Underline in UITabBarItem

元气小坏坏 提交于 2019-12-03 07:37:28
I am working in a application where i need to add underline in UITabbarItem . so i would like to add underline under the selected UITabbarItem in Default UITabbarcontroller of iOS. I have already created subclass of UITabbarcontroller but didn't find any way to add line in that. I want to do something like below image. If anyone have any idea for this please share here. AP7 Please try this one. I have used in my application once and hope it will help you too. This is how I have created Tab bar programmatically: UITabBarController *tab = [[UITabBarController alloc]init]; ViewController1 *v1 = [

iOS 7.1 issue - Tabbar icon image is automatically resize when touch and drag on that tab button

老子叫甜甜 提交于 2019-12-03 04:16:44
问题 I have this code [tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"tab_pressed_home_icon"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_home_icon"]]; tabBarItem1.imageInsets = UIEdgeInsetsMake(8, 0, -2, 0); which set an icon on the tab bar. everything work fines so far until last night that i update Xcode 5.1 and run the app on ios7.1 simulator. here is the app now when i tap the tab bar the icon image size is decrease an when i release the finger image is back to normal.

Selected state of tab bar icon in IOS 7

寵の児 提交于 2019-12-03 04:16:41
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 As of Xcode 6, you can do this by default in Interface Builder. No need for any custom subclasses or categories as before. Here is the swift solution based on @MrAlek's solution, create a custom UITabBarItem import UIKit @IBDesignable class YourTabBarItem: UITabBarItem { @IBInspectable var selectedImageName

How to set tab bar item title programmatically in objective c?

梦想与她 提交于 2019-12-03 04:08:31
问题 I want to set title to tab item programatically, but it not works. My code is below: - (IBAction)tab1Click:(id)sender { myTabBarController = [[UITabBarController alloc] init]; view2Controller = [[View2Controller alloc] init]; [view2Controller setTitle:@"title"]; view3Controller = [[View3Controller alloc] init]; deneme = [[ViewController alloc] init]; myTabBarController.viewControllers = [NSArray arrayWithObjects:deneme, view2Controller,view3Controller, nil]; [self.view addSubview

iOS 7 tabBar-line, how to remove it?

时光怂恿深爱的人放手 提交于 2019-12-03 03:30:58
问题 Apple has added a tiny line over the tabBar in iOS 7 which is supposed to work as a shadow or fade between the tabBar and the UI Since I am using a custom-made tabBar the line is quite irritating. How do you remove it? Please tell me it is possible, otherwise I need to redesign my whole app lol.... / Regards *Edit Sloved my problem with the following line of code: [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]]; 回答1: UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar_bg

Getting the frame of a particular tab bar item

五迷三道 提交于 2019-12-02 20:10:01
Is there a way to find the frame of a particular UITabBarItem in a UITabBar ? Specifically, I want to create an animation of an image "falling" into one of the tabs, similar to e.g. deleting an email in the Mail, or buying a track in the iTunes app. So I need the target coordinates for the animation. As far as I can tell, there's no public API to get the coordinates, but would love to be wrong about that. Short of that, I'll have to guesstimate the coordinates using the index of the given tab relative to the tab bar frame. Imre's implementation is missing a couple of imho important details.

Multiple lines in UITabBarItem Label

无人久伴 提交于 2019-12-02 18:46:19
问题 I've tried many things but impossible to find a way to put the label of a UITabBarItem with a lineNumber customised.0 (i would like to get the title on 2 lines). Is there a way to do it? 回答1: Now it contains two subviews. At 0 it is imageView and at 1 it is label. Now make the height of imageview a bit smaller so that you can give the height of label a bit larger to have multiple lines. Set the property ofnumberoflines of the label to 0 via code. let viewTabBar = tabBarItem.value(forKey: