Я не уверен, что расширяемый список - лучшее решение для этого, но это единственное, что мне пришло в голову.Android extablelistveiw дочерний элемент на переднем плане
Вот моя проблема:
Я хочу, чтобы создать список, и когда я нажимаю на элемент (один или, может быть, там будет несколько) element'll появляются и надавите другие элементы, которые ниже его , Вот как работает расширяемый список, но здесь возникает моя проблема: я хочу, чтобы дочерний элемент находился перед элементами группы, и я понятия не имею, как я могу это сделать. Вот это картина, возможно, вы можете лучше понять его:
Как Gavriel просил:
главная:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.example.lalala.listview.MainActivity">
<ExpandableListView
android:id="@+id/extd_list"
android:layout_height="match_parent"
android:layout_width="match_parent"/>
</android.support.design.widget.CoordinatorLayout>
Группа:
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
android:background="#000000">
<TextView
android:id="@+id/left_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_widthPercent="75%"
android:textSize="17dp"
android:textColor="#f9f93d" />
<TextView
android:id="@+id/right_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_widthPercent="25%"
android:layout_toRightOf="@+id/left_text"
android:textSize="17dp"
android:textColor="#f9f93d" />
</android.support.percent.PercentRelativeLayout>
расширен ребенок:
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="55dip"
android:orientation="vertical" >
<TextView
android:id="@+id/extended_item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="17dip"
android:paddingTop="20dp"
android:paddingBottom="20dp" />
</android.support.percent.PercentRelativeLayout>
Я предлагаю вам использовать диалоговое окно для показа вашего дочернего списка, оно автоматически перейдет в основной список как всплывающее окно – Arshad
, если я использую диалоговое представление, оно будет отображаться только в открытом списке, оно не будет толкать вниз по другим элементам @ arshadkazmi42 – FaNaT
Zoli, покажите нам макет xmls у вас есть – Gavriel