uitabbarcontroller

self.tabBarController is NULL

隐身守侯 提交于 2019-12-07 16:29:20
问题 I created a UITabBarController like the following and pushed a navigationController, but I now cannot set the title of tab bar items etc... as the tabbarcontroller is NULL. Please can you tell me where I am going wrong. UITabBarController *tabBarController = [[UITabBarController alloc] init]; LoggedInFeedNavigationController *lvc = [[LoggedInFeedNavigationController alloc] initWithAccount:account]; [tabBarController setViewControllers:[NSArray arrayWithObject:lvc]]; [tabBarController

How to connect two different Tab bar icons to same view controller with storyboard?

大憨熊 提交于 2019-12-07 15:26:26
问题 I have a tab bar controller in an iPad app with 6 items. Two of the icons will when you tap at them lead to the same view controller. This view controller has a list of items it will show, it will change slightly depending on which of the tab bar icons you tapped. How do i set this up with storyboards? Its possible to drag the relationship twice to the same view controller, but then it just shows two of the same icons on the tab bar. I want the two choices to have different icons and name.

Get selected index tabbar controller Swift

与世无争的帅哥 提交于 2019-12-07 14:06:43
问题 I'm trying to get the selected index of the tabbarController. let application = UIApplication.sharedApplication().delegate as AppDelegate let tabbarController = application.tabBarController as UITabBarController let selectedIndex = tabBarController.selectedIndex I'm getting this error: 'UITabBarController?' does not have a member named 'selectedIndex' Am I missing something? 回答1: application.tabBarController is an optional, this means it can be nil . If you are sure it will never be nil , do

Dynamic prototype cells in uitableviewcontroller using storyboards

蓝咒 提交于 2019-12-07 13:57:56
问题 I've been scratching my head over that problem for two days now and I really can't find why such behavior is happening... This is really starting to make me sick! I have an iOS app which uses storyboards built with interface builder. The opening view is a TabBarVC owning 2 tabs: Tab 1 : Navigation Controller -> TableView Controller1 -> TableView Controller2 Tab 2 : Collection View Controller -> Navigation Controller -> TableView Controller3 -> TableView Controller2(yes I meant to write that)

What's the best way of adding a custom centre button to a tab bar?

北城余情 提交于 2019-12-07 10:47:38
问题 Many apps have a standard tab bar with a custom button in the centre which performs some special function. Some examples can be found here: http://mobile-patterns.com/custom-tab-navigation What's the best way of implementing this? 回答1: Here you can see how to implement that button. I am gonna paste the code so it stays here forever: UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height); [button

Removing the rightBarButtonItem from moreNavigationController of UITabBarController

亡梦爱人 提交于 2019-12-07 10:18:59
问题 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

UITabbarController with MoreNavigationController , PoptoRootViewController issue

只谈情不闲聊 提交于 2019-12-07 09:46:07
问题 Kindly help me with this issue . I am using tabbarcontroller in my App, [tabBarController setViewControllers:tabs]; tabs Contain array of viewcontrollers (6 viewcontrollers). It automatically created more button. ISSUE When I open any viewcontroller from more button and then open any other controller from index 0 to 2 , and then press more button it maintain the last opened viewcontroller . For Example: more button tableviewcontroller screen : Now when i press Contacts let say Now when user

how to set individual tabbaritem icons in uitabbarcontroller in cocoa

社会主义新天地 提交于 2019-12-07 07:30:58
问题 I was answered how to set images in general for a uitabbarcontroller. however my uitabbarcontroller is an array of views that looks like: tabBarController = [[UITabBarController alloc] init]; viewTab1controller = [[ViewTab1Controller alloc] initWithNibName:@"ViewTab1" bundle:nil]; viewTab1controller.title = @"Schedules"; navigationTab1Controller = [[[UINavigationController alloc] initWithRootViewController:viewTab1controller] autorelease]; [viewTab1controller release]; viewTab2controller = [

Disable/Enable tabs in UITabBarController in storyboard-based app

自作多情 提交于 2019-12-07 06:35:06
问题 I've built my app with storyboards and all views are managed by a tabbarcontroller. So on launch (I'm only working on the iPad UI currently) it does this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UISplitViewController *splitViewController =

tab bar did select delegate methods give the previously selected tab index in ios, swift 3

风格不统一 提交于 2019-12-07 05:55:21
问题 I'm trying to detect which tab selected by the user, realtime. as an example, if user selecte 0 th index, at the same time I want to get that user has selected the zeroth index tab. so for that , I used tabbarcontroller delegate method like below. override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { print("the selected index is : \(selectedIndex)") } but this shows the previous view controller.as an example think I'm in second tab and then I select the first tab then this