1

For the particular application I am developing the built in keyboards are useless for me (I need to support 0-9 and X, del and nothing else). I also am after a UI with large buttons to make it easier to hit the keys.

It is easy enough to come up with a UI with the buttons, but I cannot figure how to make it so that the keyboard doesn't show up at all when the user select the TextView (I'd like them to never see it at all).

I do want the TextView feature of being able to select where the cursor is, otherwise I would punt and use a label.

Is this the wrong way all together and I should do it some other way? If not is there a way to hide the keyboard?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
TofuBeer
  • 60,850
  • 18
  • 118
  • 163

4 Answers4

1

Make the TextVeiw uneditable and the keyboard won't come up

hhafez
  • 38,949
  • 39
  • 113
  • 143
  • but then I won't have the ability to move the cursor withing the edit field. I'd rather not have to delete 10 characters because the first one was wrong (and I cannot do validation until everything is entered) – TofuBeer Mar 12 '09 at 05:03
1

No, there isn't. A textview without a keyboard is called a "label". (And that won't help you with the insertion point, but them's the breaks.)

Becca Royal-Gordon
  • 17,541
  • 7
  • 56
  • 91
  • Since a label doesn't allow for cursor movement they are not the same. – TofuBeer Mar 12 '09 at 14:09
  • 1
    I'm well aware of this. Unfortunately for you, the cursor and the keyboard are a package deal; there's no known method to get one without the other, short if implementing an insertion point yourself. – Becca Royal-Gordon Mar 13 '09 at 02:08
1

Try this:

UIView* emptyView = [ [ UIView alloc ] initWithFrame:CGRectZero ];
textView.inputView = emptyView; // this will show emptyView (=nothing) instead of keyboard
[ emptyView release ];
isak
  • 11
  • 1
0

Yes We can Do that. Done by disable the User Interaction. In your xib userinteraction is enabled like enter image description here

you have to disable the user interaction like enter image description here

If you created programmatically means, you have to write below code in viewDidLoad method like,

- (void)viewDidLoad
{
    [super viewDidLoad];
    UITextView *txtvew = [[UITextView alloc] initWithFrame:CGRectMake(50, 150, 150, 300)];
    txtvew.userInteractionEnabled = NO;

}
Arjun Sa
  • 125
  • 2
  • 13