Bug 5009 - SetBackgroundImage(backgroundImage, barMetrics) method on parameter name: backgroundImage should allow null to remove the navigationbar background.
Summary: SetBackgroundImage(backgroundImage, barMetrics) method on parameter name: bac...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-05-10 12:52 UTC by hamid_xlm
Modified: 2012-05-11 21:17 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description hamid_xlm 2012-05-10 12:52:23 UTC
I set UINavigationBar background image at root view controller, but i need to remove background image at detail view controller.

With Obj-C I use this code:

if ([[UINavigationBar class] respondsToSelector:@selector(appearance)])  
{
    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
}
so when i use this code in MonoTouch:

this.NavigationController.NavigationBar.SetBackgroundImage(null, UIBarMetrics.Default);
i receive this error:

System.ArgumentNullExeption  
Argument cannot be null  
Parameter name: backgroundImage 

SetBackgroundImage(backgroundImage, barMetrics) method on parameter name: backgroundImage should allow null to remove the navigationbar background.
Comment 1 Sebastien Pouliot 2012-05-10 13:01:59 UTC
That's in reference to http://stackoverflow.com/q/10504966/220643 right ?

This is already fixed and will be in 5.2.12. Do you want an hot fix ? (to replace monotouch.dll from 5.2.11) ?
Comment 2 Sebastien Pouliot 2012-05-10 14:16:55 UTC
QA: this was fixed in

5.2-series: 9453b6343256a79dd85fcf6adc90cb2121ac0b82
master: 5898cbbaca4507b73eb966ad262dbd2edf291c72

and unit tests were added
Comment 3 Sebastien Pouliot 2012-05-11 21:17:20 UTC
Just le me know* if you require an hotfix before 5.2.12 is released. Thanks for the report.

* I'll get an email with any follow up on the bug even if closed