Xamarin forms: How to remove android entry underline

Kudzai Dube
2 min readJun 13, 2021

--

Photo by Denny Müller on Unsplash

Introduction

If you are working with Xamarin.Forms to create a mobile application for Android and/or iOS you have lots of standard controls to use in your app. But sometimes these controls might not fit your actual needs or look exactly like your designs and so you need to think about creating your own controls or at least you feel the need to slightly edit the control itself.

In this blog post, I will show you how you can edit a predefined control e.g an entry to suit your needs without having to create a custom control.

  1. Create an effects folder in the shared project
Effects folder in the shared project

2. In the effects folder created above add a PlainEntry.cs class which inherits from RoutingEffect

3. In the android project create an AndroidPlainEntryEffect class that inherits from PlatformEffect and add the ResolutionGroupName and ExportEffect attributes

To use the newly created effect add the effects folder namespace in the xmlns line 4 and add the Entry.Effects lines 19–21

Final Output

Closing Remarks

When I encountered this issue initially most solutions pointed towards creating a custom control, so I kept digging for a better way. So the rule of thumb whenever you are faced with a case where the predefined controls don't meet your UI design requirements and you have an option to either create a custom control or use effects is to use effects if you want to make a slight modification to a control e.g remove the android line, add shadows, or slightly changing the properties of a platform-specific control and use a custom renderer when you want to create a control that does not exist in Xamarin.Forms.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Kudzai Dube
Kudzai Dube

Written by Kudzai Dube

Software Engineer by day, Lifelong learner by night. Interested in mobile development. Xamarin | C# | .NET MAUI | Flutter. Writer.

Responses (1)

Write a response