I’m subclassing UIAlertView. See code below. Nothing fancy, just set some bool if the alert is shown and reset it if it gets dismissed. But the alert never apepars on sreen. The screen gets dimmed and that’s it. I get the following message in the app output:
Requesting the window of a view (<TestApp.AlertView: 0xfad7160; baseClass = UIAlertView; frame = (0 0; 0 0); transform = [0, 0, 0, 0, 0, 0]; alpha = 0; opaque = NO; layer = (null)>) with a nil layer. This view probably hasn't received initWithFrame: or initWithCoder:.
What does this message want to tell me? I’m calling base. What more can I do?
Here’s the class:
public sealed class AlertView : UIAlertView
{
public AlertView (string title, string message,UIAlertViewDelegate del, string cancelButtonTitle, params string[] otherButtons) : base(title, message, del, cancelButtonTitle, otherButtons)
{
}
public AlertView() : base()
{
}
public AlertView(NSCoder coder) : base(coder)
{
}
public AlertView(IntPtr handle) : base(handle)
{
}
public AlertView(NSObjectFlag t) : base(t)
{
}
public override void Show ()
{
this.bIdleTimerWasRunning = AppDelegateBase.MainApplication.IsUIIdleTimerEnabled;
AppDelegateBase.MainApplication.EnableUIIdleTimer(false);
base.Show ();
}
private bool bIdleTimerWasRunning;
public override void DismissWithClickedButtonIndex (int index, bool animated)
{
AppDelegateBase.MainApplication.EnableUIIdleTimer(this.bIdleTimerWasRunning);
base.DismissWithClickedButtonIndex (index, animated);
}
}
Not sure (I need to test that further) but the default constructor for your
AlertViewworks (small text-less, button-less popup appear).From that you can fake the whole thing with something like:
Hopefully that can unblock you 🙂