Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何在输入框上设置多个过滤器?
这就是我正在尝试的:
input.setFilters( new InputFilter[] {new InputFilter.LengthFilter(20)}); input.setFilters( new InputFilter[] {new InputFilter.AllCaps()});
但是,只应用了最后一个过滤器......我在谷歌上找不到任何东西。
尝试以下方法:-
input.setFilters( new InputFilter[] {new InputFilter.LengthFilter(20), new InputFilter.AllCaps()});
或者
InputFilter[] filters = {new InputFilter.LengthFilter(20), new InputFilter.AllCaps()}; input.setFilters(filters);