EditText在最小化后不接受输入

时间:2016-07-20 12:27:59

标签: android

每当我最小化应用程序并稍后再回到它时,我的EditText都不接受任何输入。当我恢复应用程序时,我可以从一个EditText移动到另一个,但它不接受来自软键盘的任何形式的输入。这是我的布局代码

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:layout_width="match_parent"
     android:layout_height="match_parent"    
     android:paddingLeft="@dimen/activity_horizontal_margin"
     android:paddingRight="@dimen/activity_horizontal_margin"
     android:paddingTop="@dimen/activity_vertical_margin"
     android:paddingBottom="@dimen/activity_vertical_margin"
     app:layout_behavior="@string/appbar_scrolling_view_behavior"  
     tools:showIn="@layout/activity_pay"
     tools:context="com.ant.henry.gates.PayActivity">

<android.support.v4.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/all_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@drawable/background"
        android:padding="10dp"
        >

        <ImageView
            android:id="@+id/logo"
            android:layout_width="120sp"
            android:layout_height="30sp"
            android:layout_gravity="center_horizontal"
            android:contentDescription="@string/gates"
            android:src="@drawable/logo"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="10dp"/>

        <TextView
            android:id="@+id/card"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="5dp"
            android:paddingBottom="10dp"
            android:text="@string/details"
            android:textColor="@color/detail"
            android:textSize="20sp" />

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_num"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/editNum"
                android:hint="@string/number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="number"

                />
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_cit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/editCit"
                android:hint="@string/cit"
                android:layout_width="match_parent"
                android:maxLength="3"
                android:layout_height="wrap_content"
                android:inputType="number"

                />
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_expiry"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/editExpiry"
                android:hint="@string/expiry_j"
                android:layout_width="match_parent"
                android:maxLength="2"
                android:layout_height="wrap_content"
                android:inputType="number"

                />
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_expiry"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/editExpiry"
                android:hint="@string/expiry_l"
                android:maxLength="2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="number"

                />
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_pin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/editPin"
                android:hint="@string/pin"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="number"

                />
        </android.support.design.widget.TextInputLayout>
        <TextView
            android:id="@+id/info"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="8dp"
            android:paddingBottom="5dp"
            android:text="@string/info"
            android:textColor="@color/detail"
            android:textSize="20sp" />

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_bvn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/editB"
                android:hint="@string/b"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="number"

                />
        </android.support.design.widget.TextInputLayout>

        <Button
            android:id="@+id/buttonVerify"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/verify"
            android:layout_marginBottom="20dp"
            android:textColor="@drawable/bg_tab_text_color_inside"
            android:background="@color/colorPrimary"/>



    </LinearLayout>
</android.support.v4.widget.NestedScrollView>

    </RelativeLayout>

0 个答案:

没有答案