Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I have just updated to the latest MonoTouch stable version and code that was working 100% is now broken.
var color = UIColor.FromPatternImage(UIImage.FromBundle("Images/background.png"))
This code no longer works in MT 6.0.0. It shows the default iPhone lined background and on investigation in debug mode the value of the variable color is: "System.Exception: Unsupported colorspace component length: 1".
I have no idea what this means, but this has now broken after the upgrade and obviously has a dramatic affect on the look and feel of my app! The UIImage is valid and can be found correctly and as I said this worked perfectly until now.
Patterns are not "true" colors, so the later message is likely the debugger calling ToString() to give you a description of the current instance (I'll look at this).
I do not recall changes to UIColor for 6.0. Do you remember which version of MonoTouch you used before updating ?
Could you attach a test case (at least the image, in case it's related) to the bug report ? We'll have a look asap. Thanks
Created attachment 2583 [details]
Attached is a copy of the image that used to work.
Prior to MT 6.0.0 being used, I was using 5.4.0. Either something changes in the latest Xcode version or MT version. Either way, it was working and now it isn't.
Ok, the part of the "Unsupported colorspace component length: 1" is due to the debugger calling ToString (which tries to call other members than do not work for a pattern).
This (first) part is fixed in a1ab48f2b1e335a36aabb834a4dfd136f40cd183
QA: unit tests added
Created attachment 2585 [details]
File which uses the image pattern
Attached is the file which uses a UIImage to set the ParentViewController.View.BackgroundColor to a particular pattern/image. Used in Monotouch Dialog.
Usage would look as follows:
public class LoginScreen : CustomDialogViewController
public LoginScreen() : base("Login", UIImage.FromBundle("Images/background.png"))
Thanks for the extra data and the fact that this is MT.D based (it could be related to #6545).
You might want to try:
It might be that iOS6 sets a background view (different from earlier versions of iOS) and that does not mix well with your custom color (pattern).
dialog_view_menu.TableView.BackgroundView = null;
That did the trick.
*** Bug 6545 has been marked as a duplicate of this bug. ***
The issue is that iOS 6 has a background view that does not mix well with custom colors/patterns. However this is not something we can disable (it's valid and useful to be able to combine both).
IOW if you want to create a custom look you need to set every properties that can affect it, like the background view, since we can't know what visual changes future iOS releases will have.
For the record,
TableView.BackgroundView = null;
Works with iOS6 (xcode 4.5) and iOS5 (xcode 4.4.1) SDKs/simulators.