Listview verschwindet hinter listview

  • Antworten:2
  • Bentwortet
Sebastian Klaiber
  • Forum-Beiträge: 44

13.11.2010, 11:27:15 via Website

Hallo,

ich bin gerade dabei eine APP zu entwickeln, bei der ich verschiedene Kategorien habe, unterhalb jeder Kategorien will ich dann weitere Einträge anzeigen. Mein Problem ist nun, dass mir max. 2 Einträge angezeigt werden, der Rest verschwindet dann hinter der nächsten Kategorie. Hier der notwendige Xml Code! Such schon mehreren Tagen nach dem Problem, weiß aber mittlerweile nicht mehr weiter!

category.xml
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical"
4 android:layout_width="fill_parent"
5 android:layout_height="wrap_content">
6
7 <TextView android:id="@+id/name"
8 android:background="@color/catagory_bg"
9 android:padding="0dip"
10 android:textStyle="bold"
11 android:layout_width="fill_parent"
12 android:layout_height="wrap_content"/>
13
14 <ListView android:id="@+id/items"
15 android:divider="#00000000"
16 android:dividerHeight="0px"
17 android:layout_width="fill_parent"
18 android:layout_height="match_parent"/>
19
20</LinearLayout>

item.xml
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:padding="5dip"
4 android:orientation="vertical"
5 android:layout_width="fill_parent"
6 android:layout_height="wrap_content"
7 android:clickable="false"
8 android:layout_weight="1">
9
10 <TextView
11 android:id="@+id/rowid"
12 android:visibility="gone"
13 android:layout_width="wrap_content"
14 android:layout_height="wrap_content"/>
15
16 <TextView android:id="@+id/name"
17 xmlns:android="http://schemas.android.com/apk/res/android"
18 android:layout_width="fill_parent"
19 android:layout_height="wrap_content"/>
20
21</LinearLayout>

main.xml
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical"
4 android:layout_width="fill_parent"
5 android:layout_height="wrap_content"
6 android:layout_weight="1">
7
8 <ListView android:id="@id/android:list"
9 android:layout_width="fill_parent"
10 android:layout_height="wrap_content"
11 android:transcriptMode="alwaysScroll"
12 android:layout_weight="0.5"/>
13
14 <LinearLayout android:layout_width="fill_parent"
15 android:layout_height="wrap_content"
16 android:orientation="horizontal"
17 android:padding="10dip">
18
19 <EditText android:id="@+id/item_name"
20 android:layout_width="fill_parent"
21 android:layout_height="wrap_content"
22 android:layout_weight="0.5"
23 android:singleLine="true"
24 android:layout_gravity="bottom"/>
25
26 <ImageButton android:id="@+id/add_item_button"
27 android:layout_width="wrap_content"
28 android:layout_height="wrap_content"
29 android:src="@drawable/add"
30 android:layout_gravity="bottom" />
31
32 </LinearLayout>
33</LinearLayout>

Danke für eure Hilfe! Zur Verdeutlichung hab ich hier noch ein Beispiel https://cacoo.com/diagrams/CBmDjtDtHDY9Aupr

Mfg

— geändert am 13.11.2010, 11:42:44

Antworten
Markus Gu
  • Forum-Beiträge: 2.644

13.11.2010, 15:44:55 via Website

schau dir mal eine

expandable listview an - die kann haupteinträge und untereinträge

swordiApps Blog - Website

Antworten
Sebastian Klaiber
  • Forum-Beiträge: 44

13.11.2010, 15:52:13 via Website

Hast du dafür vielleicht ein gutes Beispiel?

Antworten