在项目中,一进入一个页面, EditText默认就会自动获取焦点。
在这里只需要在布局文件里面添加两条属性就可以了。
在EditText的父级控件中添加:
android:focusable="true"
android:focusableInTouchMode="true"
在EditText中添加:
android:singleLine="true"
在项目中,一进入一个页面, EditText默认就会自动获取焦点。
在这里只需要在布局文件里面添加两条属性就可以了。
在EditText的父级控件中添加:
android:focusable="true"
android:focusableInTouchMode="true"
在EditText中添加:
android:singleLine="true"
本文标题:Android取消EditText自动获取焦点行为
本文链接:https://www.haomeiwen.com/subject/znymwttx.html
网友评论