I have two entries Username and Password. The username and password is always uppercase. How can I force the keyboard or the entry that when I type something the text will be uppercase?
<Frame StyleClass="lpframe" x:Name="usernameFrame" CornerRadius="5" BorderColor="Transparent" HasShadow="False">
<StackLayout>
<Label Text="USERNAME" StyleClass="lbl-login">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="OpenSans-Semibold.ttf#OpenSans-Semibold"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<local:CustomEntry Placeholder="Username" PlaceholderColor="#879baa" Unfocused="entUser_Unfocused" StyleClass="form-control" ReturnType="Next" x:Name="entUser">
<local:CustomEntry.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="OpenSans-Regular.ttf#OpenSans-Regular"/>
</OnPlatform>
</local:CustomEntry.FontFamily>
</local:CustomEntry>
</StackLayout>
</Frame>
<Frame StyleClass="lpframe" x:Name="passwordFrame" CornerRadius="5" BorderColor="Transparent" HasShadow="False">
<StackLayout>
<Label Text="PASSWORD" StyleClass="lbl-login">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="OpenSans-Semibold.ttf#OpenSans-Semibold"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<local:CustomEntry Placeholder="Password" PlaceholderColor="#879baa" Unfocused="entPassword_Unfocused" IsPassword="True" StyleClass="form-control" ReturnType="Go" x:Name="entPassword">
<local:CustomEntry.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="OpenSans-Regular.ttf#OpenSans-Regular"/>
</OnPlatform>
</local:CustomEntry.FontFamily>
</local:CustomEntry>
</StackLayout>
</Frame>
You can do it via a
PlatformEffectfairly easily.Xaml Example:
Note: xmlns:sushi in this example is a
xmlnsfor the location of theRoutingEffectimplementationRoutingEffect in a NetStd library
This class is to be referenced via the
sushixmlns in the XAML examplePlatformEffect for Android
Note: You are adding a
InputFilterAllCapsto the Android Widget EditText's current filter list.PlatformEffect for iOS
In each one of projects that you implement a PlatformEffect, make sure you are including the
ResolutionGroupNameandExportEffectattributes so Forms' can find and activate the effect for that platform.ResolutionGroupName and ExportEffect Example::
re: https://blog.xamarin.com/customizing-xamarin-forms-controls-with-effects/