uitabbaritem

Set Action for UITabBarItem

纵然是瞬间 提交于 2019-12-12 02:15:28
问题 How can i set an action for my UITabBarItem ? Can i connect it from storyboard to code somehow? or programmatically? And if so how can it be done? My hierarchy is UITabBarController -> UINavigationController -> UITabBarItem Sorry for the noobish question but i really need an answer for this. And I couldn't find anything regarding this online. Using Swift 3 and Xcode 8 Thank you! i tired Mannopson's Answer (didn't work): class BarsViewController: UITableViewController,UISearchResultsUpdating

How to Set the Selected Item in a UITabBar From within the Code?

六眼飞鱼酱① 提交于 2019-12-11 23:34:06
问题 I'm implementing UITabBar in my app. I managed making it work by implementing UITabBarDelegate in my header file and using - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item in my .m file (as explained in this tutorial). Now, there are 3 scenarios in my app where I wish to set the selected UITabBarItem manually from within the code (and not based on user action): Upon viewDidLoad After didReceiveMemoryWarning In a certain case when the user is entering another view

Remove gradient/Gloss from UITabBarItem

a 夏天 提交于 2019-12-11 23:08:23
问题 I am customizing the UITabBar . I used my custom image in UITabBarItem . The problem is whether there is a gradient/gloss on the item. I checked Apple's app Store didn't had any of this glossy effect on its UITabBarItem . How can i remove gradient from UITabBarItem ? 回答1: You just need to put clear image as `yourImage', it may help you [[UITabBar appearance] setSelectionIndicatorImage:[UIImage {yourImage}]] Edit i just googled it and found lot of similar questions. You can also try below code

Detect a re-tab on selected UITabbarItem

梦想的初衷 提交于 2019-12-11 21:14:56
问题 I'm trying to detect a re-tab on the selected UITabbarItem . I'm using a UIWebview which url needs to be reset to the homepage again after re-tab on the Home button at index 1 in the UITabbar. Problem is: I'm using a storyboard and tried to make the UITabbar delegate, but it's not working. AppDelegate.h: #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate> @property (strong, nonatomic) UIWindow *window; @end didLaunchWithOptions:

Auto-update UITabBar item badge value

主宰稳场 提交于 2019-12-11 21:13:53
问题 In my app there UITabBar items, I want the badge value of the tab bar item to be updated every X seconds, but I can't quite figure it out... Here is my method for updating: -(void)updateTabBadgeValue{ NSLog(@"tick"); if([PFUser currentUser]!=nil){ NSLog(@"user is not null"); UIStoryboard *mySb = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil]; UITabBarController *myTbc = [mySb instantiateViewControllerWithIdentifier:@"tbc"]; NotificationNavigation *nn = [myTbc viewControllers][2];

how to use UITabBarController's shouldSelectViewController delegate method

吃可爱长大的小学妹 提交于 2019-12-11 15:37:06
问题 I have a tabbar-based application (tabbar controller is added in window itself) and all the navigation controller with their respective root view controllers are being set in window's xib. I have 4 tab bar items. Suppose I click on item 1, then the root view controller for that item is being shown to me. This root view contains a table with 5 cells. If I click on a row, then a new view is pushed onto the navigation stack. Now, this pushed view has a button clicking on which will again push a

UITabBar badge position in iOS7

大城市里の小女人 提交于 2019-12-11 09:17:53
问题 Is there anyway to position UITabBar badge? It looks little displaced in iOS7. In iOS7, it is displaced towards next tab bar item. I have used a custom tab bar item. 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)]

UITabbarController showing only first tab

烂漫一生 提交于 2019-12-11 07:36:36
问题 I manually added UITabbarController in storyboard which is not root view controller. I added tabbar items to it and set segue relationships. I also set image and title of each tabbar item in code when the first view controller of UITabbarController is about to be presented but no matter what I do only the first item's image is visible. Other items images become visible only when they are tapped and their views are actually loaded. Any inputs how to fix it ? - (void)prepareForSegue:

How do I resize the tab bar items in Xcode 4.3.1?

一世执手 提交于 2019-12-11 07:25:53
问题 I've been searching on how to resize the tab bar items on the "Tab Bar Controller," but obviously couldn't find anything. The reason why I want to do this is because I have exactly 6 items, and it causes the "more" item to be created whenever you have 6 or more. So 4 items show up on the bottom and a "more" item that shows the other two items when clicked. My title for all my items are short, so I want to squeeze 6 of them right below without the "more" and the only way to do that is to

Unable to set action for UITabbarItem Programmatically

我的未来我决定 提交于 2019-12-11 06:32:46
问题 i need to set action for my UITabbar , As when i click my tabbaritem it should go to an action which i am having in another viewcontroller. but it is redirecting to UITableview here is my code - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // create our table view controller that will display our store list FirstViewController *firstViewController =