Hello My Xamarin Friends,
This is my new post in which I am going to tell you how to customize the Entry.
Entry is a rectangular input frame control in which we can give any type of text input and in this post, we are going to discuss custom entry, this entry will make curved Corner entry.
Let's start........
First, we will create a class whose name is "CustomEntry" and then we will write a code in "C #".
Now, we will write some code in android project to set the Border Color, Width, Radius and Background Color, IsCurvedCornersEnabled ....
Please make sure to dependency reference.....
[assembly: ExportRenderer(typeof(CustomLabel), typeof(CurvedLabelRenderer))]
Then we create an Ios Project Also
Please make sure to add view reference.....
xmlns:local="clr-namespace:CustomEntryApp"
then write xaml code in main page.
TADDAAAA!
Now, you will have your CustomEntry working!!
Public Property Entry controls
This is my new post in which I am going to tell you how to customize the Entry.
Entry is a rectangular input frame control in which we can give any type of text input and in this post, we are going to discuss custom entry, this entry will make curved Corner entry.
Let's start........
First, we will create a class whose name is "CustomEntry" and then we will write a code in "C #".
Now, we will write some code in android project to set the Border Color, Width, Radius and Background Color, IsCurvedCornersEnabled ....
Please make sure to dependency reference.....
[assembly: ExportRenderer(typeof(CustomLabel), typeof(CurvedLabelRenderer))]
Then we create an Ios Project Also
Please make sure to add view reference.....
xmlns:local="clr-namespace:CustomEntryApp"
then write xaml code in main page.
TADDAAAA!
Now, you will have your CustomEntry working!!
Public Property Entry controls
- FontAttributes FontAttributes=(FontAttributes="Bold")
- FontSize Double=(FontSize="Default")
- IsPassword Boolean=(IsPassword="True")
- Placeholder String=( Placeholder="Xamarin Buddy")
- Text String (Text="Xamarin Buddy")
- PlaceholderColor Color=( PlaceholderColor="Red")
- TextColor Color=(TextColor="DarkBlue")
- FontFamily String=(FontFamily="")
- HorizontalTextAlignment TextAlignment=(HorizontalTextAlignment="Start")
Features of CustomEntry controls
- Custom Border Color Property=(CustomBorderColor="#24C4FF")
- Custom Background Color Property=(CustomBackgroundColor="#24C4FF")
- Custom Border Radius Property=(CustomBorderRadius="4")
- Custom Border Width Property=(CustomBorderWidth="4")
- Custom IsCurvedCornersEnabled =(IsCurvedCornersEnabled ="True")
To get full source code Click Here
To watch video Click Here
Awesome information. Can you help me with the CustomEntryRenderer for UWP project? It's similar to the Android? Thanks!
ReplyDeleteThks my friend.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteOn android, the background color of the Entry is Drawing out of the limits of the border. Set your custom entry's BackgroundColor to Red and you will see that on the corners of the control, the background is not being clipped as we expect. Do you know how to make it clip the background to keep is just inside of the borders ?
ReplyDeleteIt seems the original background property is not overridden in the drawable. So you have to create a new property in the CustomEntry, something like NewBackgroundColor, and then use that instead, and then just don't use the original BackgroundColor. That should solve your problem.
DeletePease add UWP!
ReplyDeleteThank you!
Thank you so much for sharing this excellent information. Your article is amazing. Good to discover your post
ReplyDeleteHire Xamarin Developer Texas, USA
I read your post its amazing and the i agree your all points because all is very good informative and meaningful in the post. Well done nice efforts Thanks you for sharing blog.
ReplyDeleteHire Xamarin Developer