Вопрос по ipad, objective-c – сплит-клавиатура для iPad

9

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Во-первых, пользователь может отсоединить клавиатуру тремя способами:

Press-and-hold the lower right key, then slide up Press-and-hold the lower right key, when the menu pops up, select "undock" Press-and-hold the lower right key, when the menu pops up, select "split"

Для случая № 1 данные уведомления из UIKeyboardWillChangeFrameNotification согласованы. Вот данные:

userInfo = {
    UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 0}, {768, 304}}";
}

Для случаев № 2 и № 3 данные противоречивы, вот что я получаю:

userInfo = {
    UIKeyboardAnimationCurveUserInfoKey = 0;
    UIKeyboardAnimationDurationUserInfoKey = "0.25";
    UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {768, 304}}";
    UIKeyboardCenterBeginUserInfoKey = "NSPoint: {384, 872}";
    UIKeyboardCenterEndUserInfoKey = "NSPoint: {384, 1136}";
    UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 0}, {768, 304}}";
    UIKeyboardFrameChangedByUserInteraction = 0;
    UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, -264}, {768, 304}}";
}

Странно то, что когда я слушаю UIKeyboardDidChangeFrameNotification в случае № 2 или № 3, данные поступают, как и ожидалось:

userInfo = {
    UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 0}, {768, 304}}";
}

Error: User Rate Limit Exceeded

Ваш Ответ

2   ответа
3

Get current orientation. If orientation is Landscape then i get height of UIKeyboardFrameEndUserInfoKey. it must equals to 216. It means keyboard is Split mode, Else not; If orientation is Portrait then i get height of UIKeyboardFrameEndUserInfoKey. it must equals to 216. It means keyboard is Split mode, Else not;

Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededUIKeyboardFrameEndUserInfoKeyError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Takeshi Kaga
Error: User Rate Limit Exceeded
1

NSArray *classPath = @[
  @"KeyboardAutomatic",
  @"KeyboardImpl",
  @"KeyboardLayoutStar",
  @"KBKeyplaneView",
  @"KBSplitImageView"
];
UIView *splitView = textField.inputAccessoryView.superview;
for (NSString *className in classPath) {
  for (UIView *subview in splitView.subviews) {
    if ([NSStringFromClass([subview class]) rangeOfString:className].location != NSNotFound) {
      splitView = subview;
      break;
    }
  }
}
BOOL isSplit = [splitView.subviews count] > 1;

inputAccessoryView

Note:textField.inputAccessoryView.superviewsuperview

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededRevealError: User Rate Limit Exceededhere.
Error: User Rate Limit Exceeded

Похожие вопросы