Forum Xamarin.Android

Setting maxLenght of a textView programmatically (got the java code )

I need to just set the maxLenght of a textView programmatically and i found this

editText.setFilters(new InputFilter[] { new InputFilter.LengthFilter(12) });

But i can make it work in my c# someone knows how?


  • StevenTheEvenStevenTheEven SEMember ✭✭✭

    Have you tried to see what for exampel intellisense says? Perhaps editText.Filters says something?

  • PatrickLockePatrickLocke USMember
    edited April 2014

    //Filter length == 10

    MyEditText.SetFilters( new IInputFilter[] { new InputFilterLengthFilter(10) } );

  • VishalSoniVishalSoni USMember

    How to restrict edit text, allow only 2 digits after decimal point.?

  • aksz88aksz88 Member

    See here the shortest way to implement Textview maxlength programatically :

Sign In or Register to comment.