We have created a special numeric keypad for the iPad. On our iPad testers, this keyboard suddenly turned out to be out of place, and it took us quite a while to realize that we could move this custom keyboard by dragging it where the Keyboard would normally be located.
Customers will have a very difficult time moving it back if they accidentally transfer it. Since it makes no sense to move the keyboard on this particular input screen, I would rather prevent the keyboard from moving, instead of drawing some kind of pen that makes it visible to users to move the keyboard. (This is a special input screen for editing only one numerical value. The keyboard is similar to part of the layout and is always visible on this screen.)
I tried, but could not find a way to prevent the keyboard from moving when dragging to the specified location. Even all my dirty ideas, like deleting, possibly, pre-existing GestureRecognizers (there were none) or placing my own button in front, did not help.
Edit: The keyboard even moves around in the simplest custom keyboard app written in Monotouch that I can think of. Did I miss something?
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace KeyboardTest
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
private UIWindow window;
private UIViewController viewController;
private UIViewController keyboardViewController;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
keyboardViewController = new UIViewController();
keyboardViewController.View.BackgroundColor = UIColor.Red;
UITextField textField = new UITextField();
textField.BorderStyle = UITextBorderStyle.RoundedRect;
textField.Frame = new System.Drawing.RectangleF(44, 44, 200, 44);
textField.InputView = keyboardViewController.View;
viewController = new UIViewController();
viewController.View.AddSubview(textField);
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
return true;
}
}
}
source
share