UITextView displays keyboard only after touching in particular area? - iphone

When I increase the frame of UITextView based on content size programmatically in keyboard hide notification delegate method,
The textview height is increased perfectly.But when I touch the UITextView bottom line, the keyboard is not coming.If i touch the area which was before
increasing frame or in actual first frame area, the keyboard is coming.How can I enable userinteraction in all area of UITextView?
Textview is as scrollview<---view1<---view2<---UItextview
Even If i increase the height of view2 and UItextview in xib, the same problem is coming.
I have disabled scrolling facility of UITextview

After increase the height of your UITextView write this bellow line , may be its problem that some view is front of UITextView...
[self.view bringSubviewToFront:yourTextView];

Related

How can i place the UITextView auto-complete bubble?

I placed UITextView for simple chat app.
But the auto-complete bubble was hidden by keyboard.
How can i place the auto-completion bubble on top of the UITextView's input?
I found the solution.
UITextView frame is bigger than original show size.
In the screenshot image, the UITextView frame is more bigger than one line size. (it was hidden by superview and keyboard)
So the bubble is placed below keyboard.
If we resize UITextView frame to one line size, then the bubble will be show on top.

Why is UITextView not scrolling when entered text reaches the level of the keyboard?

I have an iPhone screen (see attached image) where the UITextView fills almost the entire screen. When the user taps in the control the keyboard is displayed and text can be entered. However, when the text reaches the level of the top of the keyboard the UITextView does not scroll the entered text up. The result is you can not see the remaining text that is entered. Swiping up in the UITextView does not scroll the text up either. Scrolling is enabled in the UITextView.
How do you get the UITextView to automatically scroll as the text entry reaches the level of the top of the keyboard?
The UITextView scrolls automatically when text reaches its own height limit not keyboard or another object blocking the UITextView.
Maybe you can resize your UITextView when it becomes first responder to be of the height visible on the screen and resizes back to take the whole screen when it resign been first responder.

How do I stop a UIScrollView from automatically scrolling when a UITextField is touched out of the scrollview's frame?

By default, if a textfield is a child of a scrollview and is touched when it is partially outside of the frame of the parent scrollview, the scrollview scrolls up a little. For example, let's say we have a scroll view with a frame height of 200, but a contentSize height of 260 and we put a text field at position 220. Now I scroll up and position the textfield half inside of the scrollview's frame and let the other half get cut off. If I touch this textfield, I notice that the scrollview automatically scrolls up by a couple pixels before the keyboard comes up. This is problematic because I already have my own scrolling code, so when this happens, it ends up scrolling twice as far as I want it to. Is there any way to remove this default behavior?
It sounds like your scrollview is getting moved in response to the keyboard showing instead of the text field being tapped. Take a look at Apple's Managing the Keyboard documentation; it has a helpful section on scrollviews.
A similar question already has been answered here:
https://stackoverflow.com/a/5673026/550177
You can also try to reset the scrollview's contentOffset when the textfield becomes first responder. Implemement the text field delegate like this:
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
[self.scrollView setContentOffset:_scrollView.contentOffset animated:NO];
}
This code removes that automatic animation when the textfield is selected. I've tested with iOS 6.1 in the simulator.

in iPhone App set focus on textView

In my iPhone App I have put textField and TextView both
and I have grouped them with scrollview
now the problem is when I call
[textField becomeBecomeFirstResponder];
it sets focus on textField in scrollView and makes content Area visible in scrollView accordingly
But When I do same thing with UItextView:
[textView becomeBecomeFirstResponder];
it does not make TextView visible in scroll view i.e it does not focus on textView (cursor sets on text view but content area of scrollview dose not appear with out manual scrolling)
What shoud I do to set focus on textView and set content area accordingly in in scrollview?
I believe your trouble here is that UITextView is a UIScrollView, while UITextField is a UIControl.
It is quite likely, though I have not tested this in code at the moment, that the best way to handle this is to watch for textView.isFirstResponder and when true, call [scrollView scrollRectToVisible:textView.frame animated:YES] on your UIScrollView.
Be sure u have set textView's delegate.

Scrollview is bouncing back

I have a app where in once I tap on a textfield it slides on top of keyboard.
My scrollview is bouncing back when I scroll down my content. iPhone documentation says "by default, it “bounces” back when scrolling exceeds the bounds of the content."
Any clue how to get rid of this? Should I increase the content size of scrollview?
If you want to stop a UIScrollView from bouncing:
UIScrollView *myScrollView; ...
[myScrollView setBounces:NO];
If your question was about the scrolling behavior being different when the keyboard is on screen, double check that you have set the autoresize behavior of the Views appropriately.