您的位置:首页 > 移动开发 > Android开发

android EditText默认问题

2015-07-17 15:27 211 查看

取消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弹出那烦人的编辑页面啦

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: