消除EditText自动获取焦点

开发中有时不需要一进入acitivity中EditText就自动获取焦点,希望手动获取焦点,而且如果页面中有其它点击切换Activity的时候,会定到EditText处后再跳转,返回时也会定到EditText处,可讨厌。解决方法:

在EditText的父元素中设置,

android:focusable="true"

android:focusableInTouchMode="true".

出处:http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup/1612017#1612017

猜你喜欢

转载自wo9shihhy.iteye.com/blog/1879023