无法输入EditText,即使它是专注的

时间:2016-09-08 12:59:14

标签: android android-edittext baseadapter android-gallery

当我点击它所关注的edittext时,我无法输入任何内容。我已经尝试将XML edittext代码复制到另一个活动中并且工作正常,这表明它与java有关;但我不知道是什么。

代码:

ap_overview_add.xml

<?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:orientation="vertical"
    android:id="@+id/ap_overview_add_LL"
    android:background="@drawable/ap_button_background"
    android:gravity="center">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Add amount"
        android:textSize="30sp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingBottom="15dp">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:id="@+id/ap_et_add"
            android:background="@drawable/edit_text_background"
            android:inputType="numberDecimal"
            android:padding="10dp"
            android:drawableLeft="@drawable/pound_24dp"
            android:backgroundTint="@color/abc_secondary_text_material_light"
            android:imeOptions="actionSend"
            android:lines="1"
            android:maxLines="1"
            android:singleLine="true"
            android:layout_weight=".75"/>

        <Button
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:id="@+id/ap_button_add"
            android:text="Add"
            />

    </LinearLayout>
</LinearLayout>

我在一个BaseAdapter中,在getView方法中将其膨胀,如下所示:

public Integer[] mButtonIds = {
        R.id.ap_overview_tab_LL,
        R.id.ap_overview_add_LL,
        R.id.ap_overview_rem_LL
};

public Integer[] mLayoutIds = {
        R.layout.ap_overview_tab,
        R.layout.ap_overview_add,
        R.layout.ap_overview_rem
};

LinearLayout b;
View rootView;
LayoutInflater inflater;
inflater = LayoutInflater.from(mContext);
rootView = inflater.inflate(mLayoutIds[index], null);
b = (LinearLayout) rootView.findViewById(mButtonIds[index]);
return b;

在主要的活动课中我有:

GalleryImageAdapter galleryImageAdapter;
galleryImageAdapter = new GalleryImageAdapter(this);
// Initializing the custom gallery //
gallery.setAdapter(galleryImageAdapter);

0 个答案:

没有答案