AutoComplete Green UnderLine

3 posts, 0 answers
  1. Francisco Gabriel
    Francisco Gabriel avatar
    6 posts
    Member since:
    May 2017

    Posted 05 May Link to this post

    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. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1236 posts

    Posted 09 May Link to this post

    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
  3. Francisco Gabriel
    Francisco Gabriel avatar
    6 posts
    Member since:
    May 2017

    Posted 11 May in reply to Pavel R. Pavlov Link to this post

    I will try it! Thanks you!
Back to Top