Custom Button in front of Numeric Keypad

Can anyone please help me? I can't get my Button in front of the Keypad?, using obj-c I'm able to see the button in the bottom-left corner.

I've tried "BringSubviewToFront" for KeyWindow, View, Windows[1] and the button is always behind the keypad.

public override void ViewDidLoad()
{
    ...
    NSNotificationCenter.DefaultCenter.AddObserver(this, new ObjCRuntime.Selector("keyboardWillShow:"), UIKeyboard.WillShowNotification, null);
    NSNotificationCenter.DefaultCenter.AddObserver(this, new ObjCRuntime.Selector("keyboardWillHide:"), UIKeyboard.WillHideNotification, null);
}

[Action("keyboardWillShow:")]
private void KeyboardWillShow(NSNotification notification)
{
    InvokeOnMainThread(() =>
    {
        // manipulate UI controls
        UIButton buttonEnter = new UIButton(UIButtonType.Custom);
        buttonEnter.Frame = new RectangleF(0, 503, 106, 53);
        buttonEnter.SetTitle("Enter", UIControlState.Normal);
        buttonEnter.SetTitleColor(UIColor.Black, UIControlState.Normal);
        buttonEnter.Enabled = true;
        buttonEnter.Hidden = false;
        buttonEnter.Tag = 899;

        buttonEnter.TouchUpInside += HandleBtnEnterTouchUpInside;

        // TRIED UIApplication.SharedApplication.KeyWindow.AddSubview and View.AddSubview WITH NO SUCCESS

        UIApplication.SharedApplication.Windows[1].AddSubview(buttonEnter);
        UIApplication.SharedApplication.Windows[1].BringSubviewToFront(buttonEnter);

        ... Animations
    });
}
Tagged:
Sign In or Register to comment.