SORU
17 Mart 2010, ÇARŞAMBA


Program aracılığıyla Android TextView içinde maxLength?

Sabit düzen kod istemiyorum olarak ayarlayın TextView maxLength özelliği programlı olarak yapmak istiyorum. set herhangi bir yöntem maxLength ile ilgili bir şey göremiyorum.

Herkes bunu başarmak için nasıl bana rehberlik eder?

CEVAP
17 Mart 2010, ÇARŞAMBA


Böyle bir şey olmalıdır. ama asla textview için kullanılan, sadece edittext :

TextView tv = new TextView(this);
int maxLength = 10;
InputFilter[] fArray = new InputFilter[1];
fArray[0] = new InputFilter.LengthFilter(maxLength);
tv.setFilters(fArray);

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Awesomesauce Network

    Awesomesauce

    4 EKİM 2012
  • Sam Kear

    Sam Kear

    14 Temmuz 2007
  • The White House

    The White Ho

    21 Ocak 2006