示例#1
0
        private void Init()
        {
            SetMaxLines(1);
            Threshold = 0;

            ItemClick += OnItemClick;
            Adapter    = adapter = new SuggestCompleteAdapter(Context, Android.Resource.Layout.SimpleDropDownItem1Line);

            //
            //setba

            SetPadding(0, this.PaddingTop, this.PaddingRight, this.PaddingBottom);
            CompoundDrawablePadding = 25;

            Typeface tf = Typeface.CreateFromAsset(Android.App.Application.Context.Assets, "Poppins-Medium.ttf");

            this.SetTypeface(tf, TypefaceStyle.Normal);
            this.SetTextSize(Android.Util.ComplexUnitType.Dip, 14);

            this.SetHintTextColor(Android.Graphics.Color.ParseColor("#A7A7A7"));
            this.SetLinkTextColor(Android.Graphics.Color.Black);
            this.SetTextColor(Android.Graphics.Color.Black);
            this.SetBackgroundColor(Android.Graphics.Color.Transparent);

            // this.SetHighlightColor(Android.Graphics.Color.Black);
            // this.Background.SetColorFilter(Android.Graphics.Color.Black, PorterDuff.Mode.SrcAtop);

            var result = new Android.Text.InputTypes();

            result = InputTypes.ClassText | InputTypes.TextFlagNoSuggestions;

            this.InputType = result;
        }
 public NativeAutoSuggestBox(Context context) : base(context)
 {
     SetMaxLines(1);
     Threshold  = 0;
     InputType  = Android.Text.InputTypes.ClassText;
     ItemClick += OnItemClick;
     Adapter    = adapter = new SuggestCompleteAdapter(Context, Android.Resource.Layout.SimpleDropDownItem1Line);
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AndroidAutoSuggestBox"/>.
 /// </summary>
 public AndroidAutoSuggestBox(Context context) : base(context)
 {
     SetMaxLines(1);
     Threshold  = 0;
     InputType  = global::Android.Text.InputTypes.TextFlagNoSuggestions | global::Android.Text.InputTypes.TextVariationVisiblePassword; //Disables text suggestions as the auto-complete view is there to do that
     ItemClick += OnItemClick;
     Adapter    = adapter = new SuggestCompleteAdapter(Context, global::Android.Resource.Layout.SimpleDropDownItem1Line);
 }