As the first answer correctly says, setting keyboard flags is not possible out of the box. Although you can highlight a subclass Entry, there is a more elegant way by creating an attached property :
public class KeyboardStyle
{
public static BindableProperty KeyboardFlagsProperty = BindableProperty.CreateAttached(
propertyName: "KeyboardFlags",
returnType: typeof(string),
declaringType: typeof(InputView),
defaultValue: null,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: HandleKeyboardFlagsChanged);
public static void HandleKeyboardFlagsChanged(BindableObject obj, object oldValue, object newValue)
{
var entry = obj as InputView;
if(entry == null)
{
return;
}
if(newValue == null)
{
return;
}
string[] flagNames = ((string)newValue).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
KeyboardFlags allFlags = 0;
foreach (var flagName in flagNames) {
KeyboardFlags flags = 0;
Enum.TryParse<KeyboardFlags>(flagName.Trim(), out flags);
if(flags != 0)
{
allFlags |= flags;
}
}
Debug.WriteLine("Setting keyboard to: " + allFlags);
var keyboard = Keyboard.Create(allFlags);
entry.Keyboard = keyboard;
}
}
XAML ( local):
<?xml version="1.0" encoding="utf-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:KeyboardTest"
x:Class="KeyboardTest.KeyboardTestPage">
<Entry x:Name="entry" Text="Hello Keyboard" local:KeyboardStyle.KeyboardFlags="Spellcheck,CapitalizeSentence"/>
</ContentPage>
, :
<Style TargetType="Entry">
<Setter Property="local:KeyboardStyle.KeyboardFlags"
Value="Spellcheck,CapitalizeSentence"/>
</Style>