java设置EditText相关属性

  • Post author:
  • Post category:java


final EditText edt1 = new EditText(getActivity());
edt1.setMaxLines(1);
//设置可以输入任意字符
edt1.setInputType(InputType.TYPE_CLASS_TEXT);
//手动设置maxLength为20
InputFilter[] filters = {new InputFilter.LengthFilter(20)};
edt1.setFilters(filters);
edt1.setHint("调整待学单词数");



版权声明:本文为weixin_44870139原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。