uitabbarcontroller

Prevent tabbar from changing tab at specific index - IOS

不羁岁月 提交于 2019-12-19 05:13:37
问题 Thanks for reading my question. I'm trying to implement a popup menu when a user clicks the tab with the index of 4. So I'm trying to prevent the tabbar from switching viewcontroller when index 4 is pressed. Here is my code: - (BOOL) tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { if(viewController == [tabBarController.viewControllers objectAtIndex:4]){ NSLog(@"NO"); return NO; }else{ NSLog(@"YES"); return YES; } } I've

Pass data from tableview to tab bar view controller in Swift.

时光怂恿深爱的人放手 提交于 2019-12-19 04:07:48
问题 At my storyboard I have a part where a view controller with a table view is placed before a tab bar controller. This tab bar has two view controllers. Earlier I used the table view already, and when I clicked on one cell I passed to another Viewcontroller which loaded another view controller with table and cells with the id from the pushed cell from the first table. Like this: The tableview controller, prepare for segue: if segue.identifier == "overviewSegue" { var caseViewController:

Set view controllers of UITabBarController in Swift

最后都变了- 提交于 2019-12-19 04:04:46
问题 I am trying to programatically set view controllers of my custom TabBarController: import UIKit class TabBarViewController: UITabBarController, UITabBarControllerDelegate { var cameraViewController: UIViewController? var profileViewController: UIViewController? override func viewDidLoad() { super.viewDidLoad() self.delegate = self //self.viewControllers = [cameraViewController, profileViewController] as! [AnyObject]? let controllers: [UIViewController?] = [cameraViewController,

Set UITabBarController created in Interface Builder as delegate

瘦欲@ 提交于 2019-12-19 02:30:14
问题 I created my iOS app with Tab Bar template, so here is UITabBarController with bar buttons. An issue is how to set it as delegate. I found at SO that it has to be set programmatically in AppDelegate, but I believe it's impossible, because I've got no access to Tab Bar Controller as outlet. I added proper value to @interface (both ViewController and AppDelegate), but doesn't know what to do next. @interface ViewController : UIViewController <UITabBarControllerDelegate> I hope I don't have to

MGSplitViewController not as RootView but within a UIViewController

折月煮酒 提交于 2019-12-18 18:32:27
问题 I'm very new to iOS programming (Coming from Java / C++). I'm trying to set up an app with a TabBarController of which one tab should be a SplitView. I've done my research and I know that UISplitview will not work and everywhere people recommend using the MGSplitViewController. I've looked at the demo but I just can't figure out how to use it without it beeing the app's root view and can't find any sample code that could help So here is what I do with the classes from the demo in a separate

iOS: More tab crashes on my subclassed UITabBarController on iOS 7.1

北慕城南 提交于 2019-12-18 17:04:09
问题 I simply updated to iOS 7.1 and I get an unrecognized selection error for a function called "_layoutCells". I have a simple subclass of UITabBarController. 回答1: Note that this is a hack to avoid a bad crash until a better solution or explanation is found. I though I should share it. Simply add the following method to your UITabBarController subclass implementation: - (void) _layoutCells { // HACK ALERT: on iOS 7.1, this method will be called from deep within the bowels of iOS. The problem is

Check if tabBar is visible on iOS app

大城市里の小女人 提交于 2019-12-18 16:11:51
问题 I am working on an iOS App that have an UITabBarController for show a TabBar. In some where, I present a modalView full screen that hides the tabBar. I want to detect when my tabBar is visible for the user. There is any way to check automatically when de tabBar is visible or not? I tried that: But it really don't work because the tabBar is not really hidden. if ([[[appdelegate tabBarController] tabBar] isHidden]) { NSLog(@"tabBar IS HIDDEN"); } else { NSLog(@"tabBar IS VISIBLE"); } I write

Custom UITabBar icons iOS

喜欢而已 提交于 2019-12-18 12:41:12
问题 I am developing a tabbed application and i want to integrate custom UITabbar background and icons. I already inserted a custom background but i have a problem with the icons. This is how the icons are supposed to look: But after adding the icons for each view in the storyboard i get grey icons like this: Does anyone have an idea why the icons are displayed this way? Thank you very much! 回答1: This is how I do it in one of my apps. In your AppDelegates didFinishLaunchingWithOptions: method, add

Storyboard Global Tint UITabBar Tint changed in IOS 7.1

你说的曾经没有我的故事 提交于 2019-12-18 12:10:19
问题 Have I overlooked something in just using the Global Tint to set the apps overall tint? My App that worked in IOS 7.06 has suddenly changed today after IOS 7.1 Update. Basic Storyboard, Tab based App with Global Tint (Orange) set in storyboard in IB. Today updated to IOS 7.1 IPhone 5S and it is showing the standard blue tint IPhone 4 IOS 7.06, same app TabBar tint is as it should be. Had to set as below [[UITabBar appearance] setTintColor:[UIColor orangeColor]]; in the TabBarControllers

Create a modal view with navigation bar and back button

自作多情 提交于 2019-12-18 12:01:12
问题 I want to create a modal view with the navigation item (right view on my screenshot) and I want it to have a 'back button'. My app is TabBar application and I don't want this view to have a tab bar, but I want to load a previous view (left view on my screenshot) with a segue similar to the type "push". I can only create push segue to provide right navigation back to the view on the left, if it's loaded as a modal view, the NavigationBar & TabBar are gone. Any workarounds for this? Thanks in