0

Now, i'm developing a third party keyboard, and meet a problem that i want to get the candidate view of keyboard like the system keyboard, but cannot find the property or method to get it.

so i want to use these two method to solve the problem,

  1. one is to change the UIInputView's size, after i saw this, "In addition, it is not possible to display key artwork above the top row, as the system keyboard does on iPhone when you tap a key in the top row." i found it's impossible.

    [link] iOS 8 Custom Keyboard

  2. the second way is to find a property or method to get the candidate, i try to use inputAccessoryView as the candidate panel, but it's binding with UITextView and UITextField, it's belongs to the application, not custom keyboard.

here is the code
CGRect accessFrame = CGRectMake(0.0, 0.0, 768.0, 77.0);

inputAccessoryView = [[UIView alloc] initWithFrame:accessFrame];

inputAccessoryView.backgroundColor = [UIColor blueColor];

UIButton *compButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

compButton.frame = CGRectMake(313.0, 20.0, 158.0, 37.0);

[compButton setTitle: @"Word Completions" forState:UIControlStateNormal];

[compButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];

[compButton addTarget:self action:@selector(completeCurrentWord:)
            forControlEvents:UIControlEventTouchUpInside];

[inputAccessoryView addSubview:compButton];
Community
  • 1
  • 1

1 Answers1

0

Actually you can't get the candidate view like system keyboard. If you need a candidate view, the only way so far is to increase the height of your keyboard and "make" your own candidate view. See how Flesky does and you may find some inspiration.

ljk321
  • 16,242
  • 7
  • 48
  • 60