This is a migrated thread and some comments may be shown as answers.

AutoComplete Green UnderLine

2 Answers 166 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Francisco Gabriel
Top achievements
Rank 1
Francisco Gabriel asked on 05 May 2017, 08:44 AM

I want to change the color or remove the green underline of this control in Android, any way to do this? I can't see any information about this in the documentation. I think i need to do a custom render but i don't know what property i need to change.

 

Regards.

2 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 09 May 2017, 09:02 AM
Hello Francisco,

Thank you for contacting us on that matter. I understand your requirement and will try to assist you on your way. 

Please have in mind that the line that you see is default for Android platform. You can see it as well in a default ently component. The good news is that it can be easily customized. It is part of the Background of the Android component and you can change the background in order to get rid of the underline. You can find more information in this thread.

In order to customize the background in android you can use an effect. You can find a good example here.

For the Portable project you can define the effect like this:

public class AutoCompleteEffect : RoutingEffect
{
    public AutoCompleteEffect() : base("Example.AutoCompleteEffect")
    {
    }
}

 In the Android project you can use this definition:

[assembly: ResolutionGroupName("Example")]
[assembly: ExportEffect(typeof(AutoCompleteEffect), "AutoCompleteEffect")]
namespace TelerikXamarin.Android
{
    public class AutoCompleteEffect : PlatformEffect
    {
        protected override void OnAttached()
        {
            Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
        }
 
        protected override void OnDetached()
        {
            throw new NotImplementedException();
        }
    }
}

This should remove the underline. Please give this a try on your side and let us know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Francisco Gabriel
Top achievements
Rank 1
answered on 11 May 2017, 11:04 AM
I will try it! Thanks you!
Tags
AutoComplete
Asked by
Francisco Gabriel
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Francisco Gabriel
Top achievements
Rank 1
Share this question
or