select Tab Bar button

I want to hide an image when the tabBar button is pressed.I have

self.tabBarController.delegate = self;

in my app delegate and the code below is located in my view controller's .m file . but it doesn't work . Can anyone help pls ?

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{ if (viewController.tabBarController == nil) { img.hidden = YES; NSLog(@"Tab Bar Button"); } }

-------------Problems Reply------------

Do you know that

In versions of iOS prior to version 3.0, this method is called only when the selected view controller actually changes. In other words, it is not called when the same view controller is selected.

In addition to this, make sure you are hiding the imageView that contains the image.


Get the tabBarController instance in the view controller and make its delegate the view controller. Then you can call this method in the view controller.

give name for the tabbarcontroller and then set the delegate for that.If my suggestion not useful,then ask me freely

Category:iphone Views:0 Time:2011-05-09

Related post

  • Interface builder added one tab bar button, but not showing up 2009-03-31

    I replaced one tab bar button in interface builder. It was "Recent" button, I changed it to "Contacts" button. Now the tab bar button not showing up, but I could click on that position, and action does work. The neighbor unchanged tab bars have no pr

  • iPhone, how'd I overide a tab bar button to do other than the navigation controller in my mainWindow.xib 2010-11-10

    At the moment I have all my views specified in my mainWindow.xib file in interface builder. So when a tab bar button is tapped it loads the correct navigation controller. But I want to do something different in code when they tap the tab bar button f

  • how to adjust tab bar button in my app for iPhone 2010-05-06

    I am facing a problem while executing my app. all the tab buttons are not clearly visible means that they are shifted below with there current position. so give me some code to adjust the position of tab bar buttons Thanks Ritesh --------------Soluti

  • iPhone, how can I add a first view, show once, to a mainWindow but not have a tab bar button? 2010-11-16

    I need to have a view which shows first before other views but doesn't have a tab bar button. Is there a way to do this ? EDIT: I don't want to show it modally as i want to use to standard function which show other views and having to cater for diffe

  • iPhone, how I hide a tab bar button? 2010-11-16

    How do I hide an individual tab bar button ? I've searched and not found anything, only the full bar. I've made some progress but still having problems, this code is in my app delegate with an outlet to the tab bar, I'm calling it within viewDidLoad

  • Is is possible to add a 5th tab bar button instead of "More" Button? 2011-12-06

    I'm working on an iphone application that has exactly 5 tab bar buttons. I've created a custom tab bar and added 5 buttons to it, each with a separate view controller. The buttons are showing fine, but the 5th view controller is not loading on 5th ta

  • Hide center tab bar button when pushed view sets HidesBottomBarWhenPushed 2012-01-07

    I'm following the example on how to create a tab bar with a center button like Path,Instagram, etc from here: The problem I have is that when a view is pushed onto the stack that sets Hi

  • How can I make one Tab Bar button refer to two views/controllers in iOS 2012-02-13

    I'm developing an iOS app just now with a Tab Bar navigation. I have two screens which show the same information but in different formats (say, list and grid). The two screens are different enough that they require separate controllers. Users can tog

  • How to change selected tab on Button click in WPF TabControl with Buttons in Header 2009-07-02

    I have a WPF TabControl that has a couple of buttons in the TabItem header. I want the selected tab to change when a headered button is clicked. Here is a code snippet: <Page xmlns="" xmlns:

  • Setting text-color on selected tab bar item 2010-12-04

    I've created a tab bar application. I have four tabs; on the selected tab, I need to set the color red for tab title. How can i do that? Thanks in advance. --------------Solutions------------- If I understand your question correctly, you want to cust

  • Non Selected Tab Bar View Controllers aren't resized when device rotated 2011-04-29

    I'm having problems making my app iPad compatible. I have an implementation of a custom Tab Bar, based on the post here That all works fine apart from when the devi

  • Select Tab on Button Click 2011-09-11

    I have create a tabcontrol in Silverlight 4 with four tabs, is possible open a tab with button? this cose is only windows forms tabControl1.SelectedTab = tabPage4; --------------Solutions------------- Use TabControl.SelectedIndex property to change t

  • Selected tab bar icons look fuzzy if not on Retina display 2011-12-29

    I am working on an iPhone app that has a tab bar. I made the tab bar icons using a vector graphics editor and exported them to PNG. The icons look fine, except when selected. This doesn't happen on the retina display. I use self.tabBarItem.image = [U

  • Select tab using button with Asp.Net 2012-02-09

    I have a masterpage and within the Default page I have included jquery tabs with a button inside the tabs. Now If I click button it should select tab 2. So here Is what I have done <script type="text/javascript"> $("#<%=Nextbutton.ClientId%

  • Simulating selected tab bar effect 2010-10-29

    Partly as a programming exercise, and partly because we may need to include such images in an app some day, I've been trying to figure out how to draw an image like the selected tab in a UITabBar. The basic operation is simple enough in concept: the

  • Replace tab bar button in UITabBar with a UIButton 2011-06-03

    I have an application in tabbar, but I need to put a UIButton insted of a tabbar button. There are 4 tabbarbuttons in it, I want to replace the one with UIButton. Thanks. --------------Solutions------------- If you want to use UIButtton instead of ta

  • How to display selected tab bars from a list of tab bars 2011-06-07

    I have one log in page in which I want ,if the user has logged in then he/she can view more tabs than that showing to an unregistered user.It means logged in users can view more tabs. Can anybody please give me some idea? --------------Solutions-----

  • High resolution UI Elements for iPhone 4 (Tab Bar buttons-) 2010-08-14

    where can I find high resolution version of standard iPhone UI elements (like UITabBarContacts.png). I have found low resolution version of icons on some site. I need them becasue I would like to upgrade my app for iPhone 4. Thanks! --------------Sol

  • iPhone tab bar: change buttons at runtime - tab bar design guidelines 2011-11-29

    I'm developing an iOS 4 application. I have a UITabController with a tab bar with four buttons. One of them it is called play. When user taps on play button I need to change tab bars buttons: now it will have to buttons, one to turn back to previous

Copyright (C), All Rights Reserved.

processed in 0.125 (s). 11 q(s)