Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 343
Gerardo Avatar asked Jan 17 '26 00:01

Gerardo


1 Answers

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

textResultado.inputView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
[textResultado becomeFirstResponder];
like image 51
Deepak Danduprolu Avatar answered Jan 19 '26 18:01

Deepak Danduprolu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!