Android - customized keyboard key and action

前端 未结 2 558
無奈伤痛
無奈伤痛 2021-01-05 16:53

If you own Android phone you are no doubt have noticed how in the certain apps the keyboard layout can change from the standard issue to digits-only or to have .com

2条回答
  •  感动是毒
    2021-01-05 17:31

    It is controlled by the android:inputType XML attribute (or the setInputType() method).

    For info on the available options see the pages for the XML attribute or the object's method.

    As an example, the following XML:

    
    
        
    
    

    will give you this layout:

    Hosted by imgur.com

    whereas changing the inputType to textEmailAddress will give you this:

    Hosted by imgur.com

    You can customize the "action" button as explained here, but I don't believe there's any way to do full customization of keyboards at this time, but I could be wrong.

提交回复
热议问题