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.)
And checked off "Visible at Launch"
. Even though it is already visible at launch, not having that checked off screws something up.
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
Why Is -Diddeselectrowatindexpath Not Being Called
Rebuild an Nsarray by Grouping Objects That Have Matching Id Numbers
How to Call Presentviewcontroller from Within a Uicollectionviewcell
Error: Error Domain=Nsurlerrordomain Code=-1001 "The Request Timed Out."
Uiview - How to Get Notified When the View Is Loaded
How to Create a New Swift Project Without Using Storyboards
Synchronous Url Request on Swift 2
How to Run Nstimer in Background Beyond 180Sec in iOS 7
How to Add Line Break for Uilabel
Adding Blur Effect to Background in Swift
Firebase with Swift 3 Counting the Number of Children
Detect iOS Application About to Delete
Negative Number Modulo in Swift
iOS Open Youtube App with Query (Url Schemes)
The App References Non-Public Selector in Id (Facebook Sdk iOS)