expandablelistview is not getting expanded when ed

2019-07-14 06:56发布

问题:

I want to implement Expandable Listview parent groupview with Edittext.When i implement it there is a problem of edittext focus-ability.when i set edittext as focusable=true then i am able to write in edittext but my expandle listview is getting disabled and when i set focusable=false i am able to expand my list but not able to write in edittext.i think there is a problem with edittext focus-ability.i have done following with my xml file.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/txtlayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="@dimen/_5sdp"
    android:layout_marginRight="@dimen/_5sdp"
    android:background="@android:color/white"
    android:orientation="horizontal"
    android:weightSum="2">

    <LinearLayout

        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.6">

        <TextView
            android:id="@+id/lblListHeader"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="@dimen/txt_normal_padding"
            android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
            android:textColor="@android:color/black"
            android:textSize="@dimen/txt_normal_allscreen" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/edttextlayout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1.4"
        android:gravity="center">

        <EditText
            android:id="@+id/edttext"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/rectangle"
            android:focusable="false"
            android:inputType="number"
            android:singleLine="true" />

    </LinearLayout>
</LinearLayout>

i have searched a lot of for this issue but still not able to get any solution for this. i will be appreciated for any help.Thanks in advance.