IPhone Native Key and Character Keys in Objective-C

The keyboard shown below is not part of the default values ​​provided by Cocoa, so it must be custom built. I need to create a keyboard that looks like the one below.

I saw several applications that used it, I saw several tutorials that add a custom panel on top with some buttons, but I need it to look and function just like a regular keyboard, but with an extra line of number.

How can this be done programmatically in Objective-C? Can someone point me in the right direction?

enter image description here

+5
source share
3 answers

5RowQWERTY: http://code.google.com/p/networkpx/wiki/Using_5RowQWERTY

- ( ) , , API-, . , . (layout.plist).

jailbroken , . :

  • ( UIWindow, [[UIApplication sharedApplication] windows]) . , , , , Apple .

  • . , - .

  • inputAccessoryView . .

: , 3, . inputAccessoryView , .

+2

UIToolbar 0-9. , iPhone, , .

//Feel free to change the formatting to suit your needs more
//And of course, properly memory manage this (or use ARC)

UIBarButtonItem *my0Button = [[UIBarButtonItem alloc] initWithTitle:@"0" style:UIBarButtonItemStyleBordered target:self action:@selector(addNumberToString:)];
UIBarButtonItem *my1Button = [[UIBarButtonItem alloc] initWithTitle:@"1" style:UIBarButtonItemStyleBordered target:self action:@selector(addNumberToString:)];

UIToolbar *extraRow = [[UIToolbar alloc] init];
extraRow.barStyle = UIBarStyleBlack;
extraRow.translucent = YES;
extraRow.tintColor = [UIColor grayColor];
[extraRow sizeToFit];
NSArray *buttons = [NSArray arrayWithObjects: my0Button, my1Button, etc, nil];
[extraRow setItems:buttons animated:YES];
textView.inputAccessoryView = extraRow;



-(void) addNumberToString: (id) sender
{
    //Where current string is the string that you're appending to in whatever place you need to be keeping track of the current view string.
    currentString = [currentString stringByAppendingString: ((UIBarButtonItem *) sender).title;
}
+5

. : " iOS?"

:

  • , . ( , ) .

  • IB. UIButtons.

  • , .

Here's a tutorial that creates a custom inputView: http://www.raywenderlich.com/1063/ipad-for-iphone-developers-101-custom-input-view-tutorial

+1
source

All Articles