Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Autocompletetextview renderer not showing the list adapter data

$
0
0

Hi
I have written an renderer to show to show the autocompletetextview .
the textchanged event is firing .but the list is not showing up.
please find the sample code and help me out.

private static String[] COUNTRIES = new String[] { "Belgium", "France", "Italy", "Germany", "Spain" };
List strPredictiveText = new List(); ArrayAdapter adapter = null;

AutoComplete autocompletview = (AutoComplete)this.Element;

        var inflatorservice = (LayoutInflater) Context.GetSystemService(Context.LayoutInflaterService);
        var containerView = inflatorservice.Inflate (Resource.Layout.autocomplete_entry, null, false);

        var autoCompleteTextView = containerView.FindViewById<AutoCompleteTextView>(Resource.Id.txtTextSearch);
       //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.Context, Android.Resource.Layout.SimpleDropDownItem1Line, COUNTRIES);           

        autoCompleteTextView.Hint = "e.g. Hey";
       // autoCompleteTextView.Adapter = adapter;
       // autoCompleteTextView.DropDownHeight = 500;

        autoCompleteTextView.TextChanged += (sender, args) =>
        {
           // autocompletview.AutoCompleteText = autoCompleteTextView.Text;


            //strPredictiveText.Add("Satish");
            //strPredictiveText.Add("Satish1");


           adapter = new ArrayAdapter<string>(Context, Android.Resource.Layout.SimpleDropDownItem1Line, strPredictiveText); 
            autoCompleteTextView.Adapter = adapter; 
        };

        if (e.OldElement == null) {
            // perform initial setup
            base.SetNativeControl (autoCompleteTextView);
        }

Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>