【问题标题】:custom keyboard with inputAccessoryView iphone xcode带有 inputAccessoryView iphone xcode 的自定义键盘
【发布时间】:2014-03-11 16:29:44
【问题描述】:


我见过很多关于 iphone 自定义键盘的问题。但是,我找不到一个好的教程和可以轻松定制的教程。
我发现这很容易自定义,并且在用户按下键时还会弹出文本。 . https://github.com/kulpreetchilana/Custom-iOS-Keyboards

#define kChar_shift @[ @"ਔ", @"ਐ", @"ਆ", @"ਈ", @"ਊ", @"ਭ", @"ਙ", @"ਘ", @"ਧ", @"ਝ", @"ਢ",       @"ਓ", @"ਏ", @"ਅ", @"ਇ", @"ਉ", @"ਫ", @"ੜ", @"ਖ", @"ਥ", @"ਛ", @"ਠ", @"◌ੰ", @"◌ੱ", @"ਣ", @"ਫ਼", @"ਜ਼", @"ਲ਼", @"ਸ਼", @"ਞ" ]


我想为其他语言实现键盘。该教程可以用于其他语言,但我无法对其进行编辑以显示原始英文键盘。 (通过 inputAccessoryView 中的按钮切换)。如果可能,我想知道如何操作或在哪里进行编辑。

在.h

@property (strong) id<UITextInput> textView;

在.m中

-(void)setTextView:(id<UITextInput>)textView {

if ([textView isKindOfClass:[UITextView class]])
    [(UITextView *)textView setInputView:self];
else if ([textView isKindOfClass:[UITextField class]])
    [(UITextField *)textView setInputView:self];

_textView = textView;
}

-(id<UITextInput>)textView {
return _textView;
}


- (id)init
{
if (self) 
{
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PMCustomKeyboard" 
    owner:self  options:nil];
    [[nib objectAtIndex:0] setFrame:frame];
    self = [nib objectAtIndex:0];  
}
}

【问题讨论】:

  • 您的问题有解决方案吗?我也必须弹出。有什么想法吗?

标签: iphone xcode virtual uikeyboard


【解决方案1】:

不确定这篇关于创建自定义键盘以及在默认和自定义键盘之间切换的文章是否可以帮助您 - http://thekspace.com/home/component/content/article/63-ioscustomkb.html

它附带一个示例 Xcode 项目,您可以下载并试用。

【讨论】:

    【解决方案2】:

    您必须按照here 的描述处理inputViewinputAccessoryView 属性。

    【讨论】:

      猜你喜欢
      • 2010-12-09
      • 1970-01-01
      • 2017-01-03
      • 2012-03-16
      • 1970-01-01
      • 2010-10-21
      • 1970-01-01
      • 2017-11-17
      相关资源
      最近更新 更多