最近在学习android,碰到些小问题,记录下来
EditText可以在XML和代码中设置字数限制,在xml中
android:maxLength =“50”
在代码中可以
editText.setFilters( new InputFilter[]{ new InputFilter.LengthFilter( 100 )});
限制其只能输入数字的话可以
android:numeric="integer"
Copyright @ 2024 liangge0218 Powered by .NET 8.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster