UITextView keeping cursor blinking while it's not first responder - iphone

Is there a way to keep the cursor blinking when UITextView is not first responder?
Or is there any other way to put another view on top of keyboard while it's first responder?

I don't think you can keep the cursor blinking without it being firstResponder, but there is a tutorial here which shows you how to put a view over the keyboard.

Related

tap UIwebView and don't dimiss keyboard

When I tap UIWebView, the keyboard will disappear, This is not What I want , I want the keyboard remain there, any solution?
If you want your keyboard to disappear when you remove your text view, make sure to call resignFirstResponder on your text view before you remove / release your text view.
If you are touching the UIWebView while the text view is visible, then the focus changes from the text view to the web view and the keyboard dismisses, since the OS believes that any touches happening from that point are meant for the web view. If you touch the text view (if it's still visible, that is), the focus changes back to the text view and the keyboard should re-appear.
If these answers don't help you, please clarify your question.

Keyboard accessory view hiding text

I have the following problem: I have a standard UITextView which I resize once the keyboard pops up. I also have another view which I animate into view (not the standard accessory view attached to the keyboard). The problem is that I do not want text to be hidden by this view. This is what happens when I reach the last line (orange view = my custom accessory view):
Ideally, I'd like to have an automatic scroll should that happen. But I have no clue how to achieve this if I am in the last line of the UITextView. Also, scrollToVisible doesn't work in this context and I don't know if I'd get anywhere with contentInset.
Any suggestions would be welcome! Thanks.
EDIT
I suppose I would need some kind of mechanism which would allow to
make the textview only expand to the line right above the accessory view if I was entering something on the LAST LINE
have the textview expand to the keyboard if I was not editing the LINE DIRECTLY ABOVE the KEYBOARD.
Does that make sense? What I need is the opposite of contentInset, I suppose.
I simply don't want to resize the textView to just above the accessory view as it takes away screen space to display text.
I got the solution- sorry, I guess it was obvious, but it took me the whole day to figure it out:
textOfPage.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
This will offset my UITextView so that the last line is never hidden. The 100 is in pixels and can be adjusted accordingly.
What I would do is resize the textview in the textViewShouldBeginEditing method to fit above the keyboard and the newly added accessory view, and then resize it back to full screen when the keyboard is dismissed in textViewShouldEndEditing

iPhone Dev - I have some textviews inside a scrollview. Can I make it scroll up as I type into them (so I can always see what I'm typing)?

I have an app that has a scrollview with a bunch of different textviews in it (when you click on each one, a keyboard pops up and you can type into the textview). See the following pic:
Here's my problem. If I enter any more text than is entered there in the pic, it goes underneath the keyboard so you can't see what you're typing. Is there any way I can make it so that when you're typing and you get down to that last line the the pic, it will automatically continue to scroll up one line at a time so that it always shows what you're typing (with the most recent line right above the keyboard)?
The best thing to do is to resize the textview when it becomes the first responder and when it resigns as first responder.
Resize the textview to fit within visible area when the keyboard is showing
Resize the textview to it's original size when done is pressed.
Check out this post as well.
How to make a UITextField move up when keyboard is present?

UITextView: How to programmatically set selectedRange and becomeFirstResponder?

I have a UITextView containing a document. If the user touches the document, the insertion point (selectedRange property) is set appropriately and the UITextView becomes the first responder (keyboard appears). YAY!
How can I do the same thing programmatically? Let's say I have a button titled "Edit at character 1,000". I want that to set selectedRange to [1000, 0] and then make the textview become the first responder.
Problems...
textview.selectedRange setter only seems to have an effect when called from viewDidAppear.
[textview becomeFirstResponder] sets the insertion point to the end of the document.
So, the best I can do is first becomeFirstResponder and then set selectedRange. The user sees the view scroll to the bottom of the document and then back up to the desired insertion point. Kinda ugly.
Should I try to hide the ugliness by hacking 'scrollEnabled' and 'editable' flags during the transition? Or is there a better way to do this?
You may be stuck doing a hack. How about this one:
Hide the view when you set the selected range (perhaps by putting another view of the same size over the UITextView) to hide the ugly scrolling. Then when the range is selected set unhide the view, some time after viewDidAppear.

How do I hide the textfield cursor on the iPhone?

How do I hide the textfield cursor on the iPhone?
Do you mean this...
[currentlySelectedTextField resignFirstResponder];
This will cause a text field to lose focus and the keyboard to hide again.
If you want to hide the blinking cursor line... I don't think you can do that easily.