Bug 2705 - UITabBar DeSelect item does not work as it does in Obj-C
Summary: UITabBar DeSelect item does not work as it does in Obj-C
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: All Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
: 2710 ()
Depends on:
Reported: 2011-12-31 12:19 UTC by Shawn Lewis
Modified: 2012-01-10 14:16 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Shawn Lewis 2011-12-31 12:19:01 UTC
Adding a UITabBar (with NO UITabBarController) to a view, and then further adding items to the TabBar.  The ability to "de-select" an item on the UITabBar in OBJ-C IOS, is pretty simple, you merely set the SELECTEDITEM = null.  This removes any items from being selected in the TabBar (Initialized State).

In MonoTouch, once someone selects an Item in the TabBar, you can no longer RESET/or UNSELECT, only select a new item.  This is problematic, especially if your are reusing the same view, but loading different data.

When subscribing to the .ItemSelcted event in the UITabBar, or at anytime, you SHOULD be able to assign "null' to the SelectedItem property on the UITabBar.  When doing this, MonoTouch throws an exception Inavlid/NULL Exception.

mainTabBar = new UITabBar(new RectangleF(0,270,320,50));
mainTabBar.SelectedItem = null;  <--- EXCEPTION
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-01-09 17:19:11 UTC
*** Bug 2710 has been marked as a duplicate of this bug. ***
Comment 2 Sebastien Pouliot 2012-01-10 14:16:01 UTC
Fixed. It will be part of future 5.0.x and 5.1.x releases. Thanks!