Keyboard and Cursor Show, But I Can't Type Inside Uitextfields and Uitextviews

Keyboard and cursor show, but I can't type inside UITextFields and UITextViews

This was originally an iPhone app built on iOS 5. To make it an iPad app, I just duplicated the project and upgraded all the .xibs to iPad versions. I don't know if it's a bug or not, or if it's something to do with the upgrade to iOS 6, but doing it like that messes something up with the MainWindow.xib.

In the MainWindow xib, I typed in "MainViewController" for the title (It was previously blank.)

Sample Image

And checked off "Visible at Launch". Even though it is already visible at launch, not having that checked off screws something up.

Sample Image

Now all my text views and text fields work.

Cursor not showing up in UITextView

You may have changed the tint color in your custom UITextView. If the tint color is the same as the background color (normally white), then it will appear invisible.

Cursor is blinking in UITextField but keyboard doesn't appear

Does calling reloadInputViews help?

Can't type text into UITextField or UITextView in iOS6

Depending on your implementation it's either the makeKeyAndVisible method of the UIWindow class that you forgot to call inside the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method of the application delegate or corresponding Visible at Launch flag in your main interface xib file.

Cheers... :)

UITextField functionality with no keyboard

Solution:

In the end, I discovered another similar (but not exact) question here on stackoverflow, and one answer gave a solution to my problem. The way to go about it is simply to have the app display a dummy View as the keyboard, and everything else works the way it should.

UIView *dummyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)];    
VIN.inputView = dummyView; // Hide keyboard, but show blinking cursor

It works for UITextField and UITextView and they need to be set to editable.

iOS -- dealing with the inability to set the cursor position in a UITextField

I also use a UITextView for the very purpose of being able to set the cursor position.

If you subclass UITextView (which itself is a specialization of UIScrollView), you can override "scrollingEnabled" and return NO:

- (BOOL) scrollingEnabled   
{
return NO;
}

I also had to play with the contentInset and contentOffset properties to get exactly what I wanted.



Related Topics



Leave a reply



Submit