android - edittext 默认隐藏软键盘

edittext 默认隐藏软键盘

方法一:

  在 edittext 最外层的布局加入下面两句:

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

  代码如下:

 <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:orientation="horizontal" >

 <EditText
            android:id="@id/edit_news_gathering_title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:hint="@string/newsGatheringTitle"
            android:inputType="text" />
    </LinearLayout>

属于别人使用的方法,几天后整理,搜不到原引用了,抱歉。  

猜你喜欢

转载自hnmaque.iteye.com/blog/1831245