1

I am developing an application that displays a custom Keyboard (similar to Messenger's) (containing images). I have been asked to add a button that changes the frame of the keyboard with an animation. But when i set the frame it does not change at all. Is this possible to do ? Could this be done nicely or do i need some work around ?

rokridi
  • 1,565
  • 2
  • 11
  • 20

1 Answers1

0

You can use inputView Property Of TextField,

UITextField *textFieldWithCustomView;
UIView *customView;
[textFieldWithCustomView setInputView:customView];

and when you want to expand/Collapse use

- (void)toggleCustomView:(BOOL)expand
{
    if (expand) {
        [textFieldWithCustomView becomeFirstResponder];
    }
    else
    {
        [textFieldWithCustomView resignFirstResponder];
    }
}

When you want to show key board use

[self toggleCustomView:YES];

Hope this helps.

Saif
  • 2,678
  • 2
  • 22
  • 38
  • I am sorry i think i did not make my self clear. When saying "Expand/Collapse" i did not mean "Hide/Show" but i meant changing the frame of the custom keyboard. I have been asked to add a feature that allows to change the size of the keyboard with an animation. Lets suppose the custom keyboard have an initial size (320, 216). When i tap the button, the keyboard size should change (animated) to (320, 400). And when i tap the button again, the frame should return to its initial value. – rokridi Feb 04 '15 at 12:38