Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Display Requirement Specific Keyboard Using Xamarin.Forms

DZone's Guide to

Display Requirement Specific Keyboard Using Xamarin.Forms

· Mobile Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

Xamarin uses the Keyboard class to show different virtual keyboards depending upon the user request. It contains several static properties to create different kind of virtual keyboards. Xamarin displays the Default Keyboard, if nothing is specified.

Keyboard for Chatting

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Chat 
            }
        }
    }
};

ChatKeyboard

It opens up the default virtual keyboard in the device, which would be convenient for chatting, having few extra keys.

Keyboard for Email entry

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Email 
            }
        }
    }
};

It opens up the same text virtual keyboard with some additional options for Email entering.

Keyboard for Numeric input

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Numeric
            }
        }
    }
};

NumericKeyboard

It opens up the numeric virtual keyboard in the device. It helps entering numbers and decimals in the entry field.

Keyboard for Telephone number input

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Telephone
            }
        }
    }
};

This opens up the numeric virtual keyboard in the device with some additional keys like +, *, #, – etc to help user in entering telephone number.

Keyboard for Text input

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Text
            }
        }
    }
};

It opens up a very much similar keyboard as the Default one.

Keyboard for Url input

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Url
            }
        }
    }
};

The keyboard opened up by this method is same as like the Email.

Keyboard to make the first letter of the sentence capitalized

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Create(KeyboardFlags.CapitalizeSentence)
            }
        }
    }
};

CapalizedKeyboard

It opens up the same Default keyboard but makes first letter of the sentence automatically capitalized.

Keyboard for spell checking

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Create(KeyboardFlags.Spellcheck)
            }
        }
    }
};

SpellKeybord

It opens up the same Default keyboard but checks the spelling during typing.

Keyboard to auto suggest the word

MainPage = new ContentPage()
{
    Content = new StackLayout()
    {
        Children = 
        { 
            new Entry()
            {
                Keyboard = Keyboard.Create(KeyboardFlags.Suggestions)
            }
        }
    }
};

SuggestionKeyboard

It opens up the same Default keyboard but suggest the words to the user during typing.

Happy coding  :)

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

Topics:
java ,mobile ,android ,tutorial ,visual studio ,csharp ,windows phone ,ios ,xamarin ,cross platform mobile app

Published at DZone with permission of Nirmal Hota, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}