如何在iOS键盘按键上显示美国手语

如何在iOS键盘按键上显示美国手语

本文介绍了如何在iOS键盘按键上显示美国手语(手势)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have to create a custom keyboard which support American Sign Language. For that I have to convert English language keyboard's keys symbols to American Sign language hand symbols keys. So how to translate (English Alphabets) to ASL- (Hand Sign) on iOS Keyboard.

查看以下内容:如何在IOS中模拟手语键盘?

我们必须做相反的事情.即键盘上的手势.而且,当用户按手势符号输入字母时,受尊重的字母将显示在文本编辑器中.

We have to do opposite of this. i.e Hand Signs on Keyboard. And when user press hand sign keys alphabets it's respected alphabet will show up in text editor.

提示:手语支持字体.我正在使用"Gallaudet-Regular"字体在键盘按键上绘制手形符号.但无法做到这一点.

Hint: Sign Language support fonts. And i am using "Gallaudet-Regular" font to draw hand symbols on keyboard key. But not able to do the same.

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

Note- Below is the code for creating the custom keyboard extension in iOS. When you use the below code, it will create a keyboard button with Hand Symbol on key but when i use to tap the keyboard key it gives 'a' as text but i want hand symbol when i tap.

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

Code:Step 1:// Creating a custom button

    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步://对按钮选择器执行操作

Step 2:// Performing action on button selector

func tapKeyboardButton(sender:UIButton){

func tapKeyboardButton(sender:UIButton) {

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

我希望按钮标题成为文本编辑器中的手势.

I want button title to be a hand sign in text editor.

推荐答案

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

You should try to install http://www.lifeprint.com/asl101/pages-layout/gallaudettruetypefont.htm font and change the font settings to Gallaudettruetype font. This should resolve the problem.Although I'm not an iOS developer but can help you in understanding the logic

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

Update: If you can install that font in your device(iPhone, iPad) then you should be able to change the input type too(keyboard). This would completely resolve your problem. I'm not sure how would you do this but this should be the logic and you should go ahead in this direction.

这篇关于如何在iOS键盘按键上显示美国手语(手势)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 13:45