On iPhone, in Xcode, I can show a popup view which overlays everything, including the Tab Bar, etc, by using code like this –
[[[[UIApplication sharedApplication] delegate] window] addSubview:mySpecialView];
I’m trying to do the same in MonoTouch, and the code I’m using is this –
UIApplication.SharedApplication.Delegate.Window.AddSubview(mySpecialView);
…but this crashes. Does anyone have any idea what I’m doing wrong?
Thanks for any help.
You did not say how it crashed – but I assume you’re having a
ModelNotImplementedExceptionwhile using theWindowproperty since it’s not implemented by default (and is meant for storyboard).You can either implement it to return the
windowfield of the (autogenerated)AppDelegate(AppDelegate.cs file) or expose the same variable as a (static) field.E.g. the default generated code
would become: