默认不让弹出键盘

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qulonglong110/article/details/81136157

在edittext前面的任意控件的xml中添加

android:focusable="true"

android:focusableInTouchMode="true"

(亲测可用)

例如:直接添加在  CheckBox  或者 LinearLayout上就可以  

<CheckBox
    android:id="@+id/btn_show_password"
    style="@style/CustomCheckboxTheme_Wpd"
    android:layout_width="30dp"
    android:visibility="gone"
android:focusable="true"
android:focusableInTouchMode="true"
    android:layout_height="@dimen/common_button_height"
    android:layout_gravity="center_vertical"/>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="@dimen/input_textfield_height"
    android:layout_marginLeft="12dp"
android:focusable="true"
android:focusableInTouchMode="true"
    android:layout_gravity="center_vertical"
    android:gravity="center_vertical"
    android:orientation="horizontal">

    <EditText
        android:id="@+id/input_text_filed"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:textSize="16sp"
        android:text=""/>
    
</LinearLayout>

猜你喜欢

转载自blog.csdn.net/qulonglong110/article/details/81136157
今日推荐