expandablelistview is not getting expanded when edittext is added in parent xml

天大地大妈咪最大 提交于 2019-12-23 23:08:25

问题


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.

来源:https://stackoverflow.com/questions/41612903/expandablelistview-is-not-getting-expanded-when-edittext-is-added-in-parent-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!