android EditText默认问题

来源:互联网 发布:pk10网站源码 编辑:程序博客网 时间:2024/06/06 21:07

取消EditText默认行为

在android中,进入一个页面后 EditText就会默认自动获取焦点。

取消方法:

在EditText的父级控件中设置:
android:focusable="true" android:focusableInTouchMode="true"

如:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:focusable="true"    android:focusableInTouchMode="true"><EditText        android:id="@+id/editext"        android:layout_width="match_parent"        android:layout_height="wrap_content" /></LinearLayout>

这样以后每次点击进入页面就看不到editext弹出那烦人的编辑页面啦

0 0
原创粉丝点击