[self doneWithNumberPad];
-(void)doneWithNumberPad
{
UIToolbar* doneToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
doneToolbar.barStyle = UIBarStyleBlackTranslucent;
doneToolbar.items = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
[[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneButtonAction)],
nil];
[doneToolbar sizeToFit];
self.textViewDescription.inputAccessoryView = doneToolbar;
}
-(void)doneButtonAction
{
[self.textViewDescription resignFirstResponder];
}
No comments:
Post a Comment