Android EditText默认不获取焦点

1.当页面中有多个EditText时,第一个EditText会自动获取焦点,取消的办法:

在EditText的父View中调用:

android:focusable="true"  
android:focusableInTouchMode="true"

eg:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:focusable="true"
        android:focusableInTouchMode="true">
        <EditText
            android:id="@+id/edittext"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="edittext"/>

    </LinearLayout>    

 

posted @ 2016-01-20 15:14  Michelle's Home  阅读(953)  评论(0)    收藏  举报