2016-05-16 10 views
1

簡単なTo-Doリストアプリで作業中です。私はExpandableListViewを使ってタスクを表示します。何らかの理由で、私はグループと子ビューの間に奇妙な空間を得続けます。私はxmlの0dpに分周器の高さを設定しようとしましたが、何も変更されません。Expandable List View - 子ビューとグループビューの間のスペース

screenshot of the space

ExpandableListViewのための私のXMLコード:

<ExpandableListView android:id="@+id/myList" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/addTask"/> 

EDIT:

子ビューのXML:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="match_parent" 
       android:layout_height="130dp" 
       android:background="#ff0000"> 



<TextView android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/displayDetails" 
       android:text="@string/detailsChild" 
       android:textColor="#ffffff"/> 

親ビューのxml:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="match_parent" 
       android:background="#424242" 
       android:layout_height="130dp" 
       android:id="@+id/layoutCustom"> 

<View android:layout_width="fill_parent" android:layout_height="30dp" 
     android:background="#FFFFFF" 
     android:id="@+id/SpaceView" 
     /> 


<TextView 
       android:layout_below="@id/SpaceView" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textColor="#FFFFFF" 
       android:textSize="16sp" 
       android:text="@string/nameofcourse" 
       android:id="@+id/course" android:layout_margin="10dp"/> 


    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="@string/date" 
      android:id="@+id/date" 
      android:textColor="#FFFFFF" 
      android:textSize="16sp" 
      android:layout_below="@+id/course" 
      android:layout_marginLeft="10dp"/> 


<TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/date" 
      android:textColor="#FFFFFF" 
      android:textSize="16sp" 
      android:text="@string/typeoftask" 
      android:layout_marginLeft="10dp" 
      android:id="@+id/type" android:layout_marginTop="10dp"/> 

<Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="@string/delete" 
      android:textSize="26sp" 
      android:textColor="#FE2E2E" 
      android:id="@+id/delete" 
      android:minWidth="20dp" 
      android:minHeight="0dp" 
      android:focusable="false" 
      android:layout_below="@+id/SpaceView"  android:layout_alignParentRight="true" 
      android:layout_alignParentEnd="true"/> 

<ImageButton android:layout_width="40dp" android:layout_height="50dp" 
      android:id="@+id/mainEdit" 
      android:src="@drawable/edit2" 
      android:focusable="false" 
      android:layout_below="@+id/date" 
      android:layout_alignParentRight="true"/> 



</RelativeLayout> 

みんなありがとうと良い週持っています!

+0

あなたは '子とグループビューのxml'ファイルを追加することができ、あなたが自分自身をチェックし、それが助けかどうかを確認することができ、ここでxmlを貼り付けるのですか? –

+0

投稿を編集して追加しました – baki1995

+0

ヘッダー/フッターの区切り記号ですか? ExpandableListViewでandroid:headerDividersEnabled = falseを設定して、それが機能するかどうか確認してください。 – Dave

答えて

0

私は私があなたのlayoutファイルをしようとしたとき、それはdividerHeight0dpに設定されていてもdividerを示していたが、android:dividerにいくつかのカスタム色を設定し、設定し、実際にこの原因が何であるかを取得していませんdividerHeight0dpは、whiteのスペースを削除しました。私は

<ExpandableListView android:id="@+id/myList" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:divider="#000" <!-- Use any color or drawable --> 
     android:dividerHeight="0dp" 
     android:layout_below="@+id/addTask"/> 
+0

作品ありがとうございました! – baki1995

+0

それを聞いてうれしいです:) –

関連する問題