uitabbarcontroller

How to change tabbar icon color from default blue?

和自甴很熟 提交于 2019-12-05 23:25:37
问题 I have got four tabs. I was able to change the tab icon color from default blue to red (or probably any color) and it works perfectly fine. The problem is it works only for three tabbaritems and last one is default blue. Below is the code. I'm coding this in rootviewcontrollerAppDelegate.m You could try this by pasting the below code in your appdelegate. Could you guys help me out I'd be so greatful! @implementation UITabBar (ColorExtensions) - (void)recolorItemsWithColor:(UIColor *)color

Creating a UITabBarController using a NIB outside of AppDelegate?

99封情书 提交于 2019-12-05 23:14:24
Still new to iOS programming, and despite copious amounts of research, I have run in to another roadblock. What I want to implement: I want a UITabBarController that gets loaded when I navigate from the main UI. I would also like to use a NIB to define its properties. All of the examples I can find put the UITabBarController in the AppDelegate, but I would not like to load it unless it gets used. I also dont know if all of the UIGestureRecognizers would remain active if I just did it modally (I cant get a working implementation). What I have so far First, I load an initial loading view from

How to update a UITableView in detailview when changes the tabbar in the pop over controller?

半腔热情 提交于 2019-12-05 22:57:35
问题 I am creating an iPad app with splitview, here is the screen shot, In this one, I want to update the values in the righthand side tableview, when I change the tab in the masterview controller (left hand side). Which will be the good aproach, Should I load another viewcontroller for each tab change? Is it possible? Or just update the table? For all the tab changes i want to display a tableview with different data. I used following code, i can see the changes in the log, but the table is not

How to set tabBarItem's badge from AppDelegate.m (tabBarView is not root View) [duplicate]

只愿长相守 提交于 2019-12-05 22:29:42
This question already has an answer here: Best way to update badgeValue of UITabBarController from a UIView 3 answers I can change badge value in AppDelegate.m by following code: UITabBarController *tabController = (UITabBarController *)self.window.rootViewController; [[tabController.viewControllers objectAtIndex:0] tabBarItem].badgeValue = @"Badge"; Only if the tabBarViewController is window's root view controller. However, in my new program, tabBarController is not root view. I have tried following code: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil

How to create translucent (with content behind it) UITabBar

狂风中的少年 提交于 2019-12-05 21:33:04
I have subclassed UITabBar and overriden drawRect: method to make it transparent (and make it look like I need to). Problem I am having is that the view added to UITabBarController does not cover whole screen but ends 49 pixels above bottom, so even tho I have transparent tabbar, I can't see thing behind it. Is there proper way how I can set size of UIView inside UITabBarController to cover entire screen? P.S.:I know it is not good idea to show content behind tabbar. I do not want to show any content there, just art, that is specific to each View and needs to be visible through tabbar. If you

Tab Bar Item title before appear Storyboard

ε祈祈猫儿з 提交于 2019-12-05 18:29:28
my app starts with a tab bar controller which have 5 tabs. At start the first one in presented with its name but the other four don't have a name until I click on them. Then the name appears depending which language the user has. How can I set the name of the tabs before the tab bar appears? I am using storyboard. Is there a way to set title at the tab bar programmatically when all the rest is done with storyboard? I tried in the AppDelegate something like [FirstViewController setTitle:NSLocalizedString(@"Titel1", nil)]; But I got an error that there is no class method for selector setTitle.

Swift

有些话、适合烂在心里 提交于 2019-12-05 18:23:24
Swift - 重写UIKit框架类的init初始化方法(以UITabBarController为例) 原来写了篇文章讲UITabBarController的用法,当时是从UIViewController跳转到UITabBarController页面,代码如下: 1 self .presentViewController( MainTabViewController (), animated: true , completion: nil ) 有网友问:如果跳转的时候想给UITabBarController传递参数,要如何实现? 方法1:可以给UITabBarController实例对象的内部变量赋值 1 2 3 4 5 6 7 8 9 10 11 12 let tabController = MainTabViewController () tabController.param = "这个是传递的参数" self .presentViewController(tabController, animated: true , completion: nil ) class MainTabViewController : UITabBarController { var param: String ? override func viewDidLoad() { } }

Same view in multiple tabs

心已入冬 提交于 2019-12-05 14:20:08
My app has a UITabBar with four tabs... each with its own custom UIViewController. Three of them have a map plus other UI elements in common, in the same place on the screen.. in two of these views the map is initially hidden. It seems like it would make more sense to make these three view the same instance of the same view controller.. and just hide/show elements. Is it possible to do this with the tab bar? I don't think those who answered "yes" read your question closely enough. You asked if it's possible to "make these three view the same instance of the same view controller". You can

Removing the rightBarButtonItem from moreNavigationController of UITabBarController

筅森魡賤 提交于 2019-12-05 14:13:57
I have added tabBar in my app and remove the rightBarButtonItem with the code: UITableView *moreTableView = (UITableView *)tabController.moreNavigationController.topViewController.view; tabController.moreNavigationController.navigationBar.topItem.rightBarButtonItem = nil; Now, when I navigate to other screen and click More button of tabBar , rightBarButtonItem appears again. If I uses back navigation button it doesn't appear and works fine. However, when I tap More button from tabBar it appears again. I used tabController.customizableViewControllers = nil; and it worked fine :) You should call

Passing a managedObjectContext through to a UITabBarController's views

白昼怎懂夜的黑 提交于 2019-12-05 13:39:06
I have an app which is based on the Utility template (where you flip over the view to see another). On the first view there is a login screen, then it flips over to reveal a UITabBar style interface. I'm having trouble working out how to pass the managedObjectContext from the App Delegate (where it is created) all the way through to each of the Tab Bar's views. App Delegate's managedObjectContext get passed to FrontLoginViewController which gets passed to BackViewTabBarViewController .. where next? The BackViewTabBarViewController nib has a UITabBarController with a UINavigationController for