Android Keyboard Tutorial [简体中文]

[制作插件的目的]

 Unity提供的安卓键盘是比本机代码提供的非常有限制组合型文字有 input.comopositionstring 不能正常的活动情况而且 hideinput 也不能正常的活我把这样的环境里改变可以脱离了加以可以活用adjustResize 选项。  

 

 

[要求规格]

 Unity 4.6.3 or higher

NGUI 3.5.0 or higher

Android Minimum API Level: 9 (Android 2.3.1 Gingerbread)

 

 

[AndroidMenifest.xml  生成与修改]

  1. 来有AndroidMenifest.xml 话加以下面的代号

<activity

           android:name=com.OhYeahDev.softInput.KeyboardActivity

           android:configChanges=orientation|fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen

           >

</activity>

 

  1. 来没有Main Activity 这代号里加上下面的代号

 <intent-filter>

          <action android:name=android.intent.action.MAIN />

          <category android:name=android.intent.category.LAUNCHER />

</intent-filter>

</activity>

 

  1. AndroidMenifest.xml 没有的话把Sample_AndroidMainfest.xml复制在Assets/Plugins/Android文件夹后 撤除‘SamPle_’

 

 

[动活化]

AndroidKeyboardManager.Install()”  条理把应用驱动时得要一定召唤 

 

 

[发键盘与设定法]

  1. 在脚本上固定命名空

  1. Unity 提供的 TouchScreen keyboard方式来使用就可以

 

 

[设定加以选项]

  1. fullScreen
  • Landscape画面上有效的选项
  • 键盘设定全屏        

Non-FullScreen

 

  1. No Suggestions
  • 撤除键盘上的“Suggestion WordsBar

This option doesn’t work on certain hardware.

* 只在Landscape 上可以

 


  1. SoftInputMode
  • InputAdjustType.SOFT_INPUT_ADJUST_RESIZE 

 键盘位置在画面

  • InputAdjustType.SOFT_INPUT_ADJUST_PAN 

 跟上面反过来固定画面后发键盘

   4. KeepKeyboardOn

  • AdditionalOptions.keepKeyboardOn = true;
  • Keyboard is not hidden when the “Done” button is clicked

 

 

[固定高级选项]

  1. 可以加衣许多的FlagMask。(参考InputType.cs)

 

 

 

[NGUI连动]         

  1. Assets/Plugins/Android/AndroidKeyboard/NGUI/UIIput.zip 文件压缩后把他覆盖到基本的文件上
  • 2015现在有NGUI 3.8.0, 3.9.0版本
  • 发键盘前得要固定完成选项设定。(hideinput,搜房日内普通M哦的,No suggestion,fullScreen
  • hideinput 得要注意下面的代

 

  1. 设置InputTest_NGUI.apk 后可以试验NGUI连动

     

 

[Example Scenes]

Test_Landscape, Test_Portrait 是把使用 UnityEngine.UI来有试验键盘的技能的目的

  • 为试验,hide input没有光不可以选择(Drag)

     

     


 

Posted in Tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>