Xamarin Forms: FloatingTextEntry Control
This is a very beautiful extended Entry control for Xamarin.Forms that allows devs display TextInputLayout(Material Design)-like
Download the code source from here:
https://github.com/AlejandroRuiz/FloatingTextEntry
this is the control usage and setup:
And the result is the next:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup | |
- iOS | |
-- Add the following line in your AppDelegate: | |
FloatingTextEntryRenderer.Init (); | |
- Android | |
-- 1 Add material design to you Xamarin.Forms app. | |
Look at this tutorial https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/ | |
-- 2 Setup the color. | |
In your theme xml add the following nodes: | |
//Accent Color | |
<item name="colorAccent">@color/accent</item> | |
//Inactive stroke color | |
<item name="colorControlNormal">@color/primaryDark</item> | |
//Inactive hint text color | |
<item name="android:textColorHint">@color/primaryDark</item> | |
-- 3 Setup your app. | |
Add the fallowing code in your Main Activity "OnStart" method: | |
FloatingTextEntryRenderer.Init (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var passEntry = new FloatingTextEntry (); | |
passEntry.Placeholder = "Password"; | |
passEntry.AccentColor = Color.FromHex("#FFC107"); | |
passEntry.InactiveAccentColor = Color.FromHex ("#1976D2"); | |
passEntry.TextColor = Color.Purple; | |
passEntry.Completed += passEntry_Completed; | |
passEntry.IsPassword = true; | |
//Custom Error Message/Color/Validator | |
passEntry.ErrorColor = Color.Red; | |
passEntry.ErrorText = "Bad Email"; | |
//Put default emailvalidator | |
passEntry.Validator = FloatingTextEntry.EmailValidator; | |
//or create your own validator | |
passEntry.Validator = (string input) => { | |
return !string.IsNullOrWhiteSpace (input); | |
}; |
Download the code source from here:
https://github.com/AlejandroRuiz/FloatingTextEntry
Informative blog! I am truly awed by this blog post! Very clear explanation about the Xamarin Development. I agree with all points.
ResponderEliminarHire affordable Xamarin Developer