ios - 如何在 iOS 键盘键上显示美国手语 (Hand Signs)?

标签 ios objective-c swift custom-font system-preferences

enter image description here我必须创建一个支持美国手语的自定义键盘。为此,我必须将英语键盘的键符号转换为美国手语手符号键。那么如何在 iOS 键盘上将(英文字母)翻译成 ASL-(手势)。

看这个: How to simulate a sign language keyboard in IOS?

我们必须做相反的事情。即键盘上的手势。当用户按下手势键字母表时,它所尊重的字母表将显示在文本编辑器中。

提示:手语支持字体。我正在使用“Gallaudet-Regular”字体在键盘键上绘制手形符号。但不能做同样的事情。

注意- 下面是在 iOS 中创建自定义键盘扩展的代码。当您使用下面的代码时,它会创建一个键盘按钮,按键上有手形符号,但是当我用来点击键盘键时,它会给出“a”作为文本,但我在点击时想要手形符号。

代码: 步骤1: //创建自定义按钮

    self.testingButton = UIButton.buttonWithType(.System) as UIButton
    self.testingButton.setTitle(NSLocalizedString("a", comment: "Title for 'First Keyboard' button"), forState: .Normal)
    self.testingButton.sizeToFit()
    self.testingButton.titleLabel?.font = UIFont(name: "Gallaudet-Regular", size: 50)
    self.testingButton.backgroundColor = UIColor.redColor()
    self.testingButton.setTranslatesAutoresizingMaskIntoConstraints(false)
    self.testingButton.addTarget(self, action: "tapKeyboardButton:", forControlEvents: .TouchUpInside)
    self.view.addSubview(self.testingButton)

第 2 步: //对按钮选择器执行操作

func tapKeyboardButton(sender:UIButton) {

    let title = sender.titleForState(UIControlState.Normal)
    var proxy = textDocumentProxy as UITextDocumentProxy
    proxy.insertText(title!)
}

我希望按钮标题是文本编辑器中的手势。

最佳答案

您应该尝试安装 http://www.lifeprint.com/asl101/pages-layout/gallaudettruetypefont.htm字体并将字体设置更改为 Gallaudettruetype 字体。这应该可以解决问题。 虽然我不是 iOS 开发人员,但可以帮助您理解逻辑

更新: 如果您可以在您的设备(iPhone、iPad)中安装该字体,那么您应该也可以更改输入类型(键盘)。这将完全解决您的问题。我不确定你会怎么做,但这应该是逻辑,你应该朝这个方向前进。

关于ios - 如何在 iOS 键盘键上显示美国手语 (Hand Signs)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28695240/

相关文章:

ios - 错误 : Found nil while unwrapping an Optional value; While Pass Data to the New Controller

ios - Swift 和 UILabel - fatal error : unexpectedly found nil while unwrapping an Optional value

ios - Titanium - 在 iOS native 模块中包装 ADTECHMobileSDK 的 CoreData 错误

ios - UICollectionViewCell 内的标签文本根据 if 语句和数组的值而变化

swift - Swift 3 中 DispatchQueue 上的 AutoreleaseFrequency

iphone - ios<= 6 中的 cocos2d 方向问题

ios - MvvmCross:iOS 中的绑定(bind)进度条

iOS Guided Access 模式破坏了 HTML <select>

objective-c - 隐藏公共(public)框架 header 中的属性,但在内部保持可用

ios - performSelectorInBackground 上的 EXC_BAD_ACCESS