Gerardo
Gerardo

Reputation: 5830

Iphone textfield display cursor

i'm developing a calculator for iphone. The design is similar to this:

The problem is that i can't show the cursor in my textField because the input is managed from buttons like the image. Moreover [textField becomeFirstResponder ] doesn't work because it shows the default keyboard.

So i tried to

textResultado.inputView = scrollView;

but then the tabBarController can't receive touch events because my custom keyboard contained in the scroll view is over it.

The caption is from an app in the AppStore so must be a way in order to solve this problem (show the cursor in a TextField using a different inputView and the tabBar still working fine).

Anyone can help me?

Upvotes: 3

Views: 1822

Answers (2)

Dario Fiumicello
Dario Fiumicello

Reputation: 768

I discover that using this solution you can have strange flickering of the gui on iPhone 4 with iOS 6.1.3. iPhone 3Gs with iOS 6.1.3 works correctly.

The flicker appears when text area is selected and a dialog window appears. Closing the dialog window causes flickering.

Upvotes: 0

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

Create an input view which is invisible and then make textResultado the first responder.

textResultado.inputView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
[textResultado becomeFirstResponder];

Upvotes: 2

Related Questions