2011-09-11 7 views
0

ここで私の質問に答えてください:Fixed footer not displaying the bottom-most list itemTouchListview with fixed footer

しかし、それは私のためには機能しません。

私は下部に固定フッターを持つリストビューが必要です。現時点では、リストビューはウィンドウと同じ大きさであり、フッターが重なります。 XML:

<?xml version="1.0" encoding="utf-8" ?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/root" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical"> 

    <!-- <ImageView 
android:layout_width="fill_parent" android:layout_height="fill_parent" 
android:src="@drawable/baby_blue_solid" android:scaleType="centerCrop" />--> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/footer_cloud" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center_vertical" 
    android:layout_alignParentBottom="true" 
    > 

    <ImageView android:id="@+id/add_icon" 
     android:layout_centerInParent="true" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
       android:src="@drawable/ic_menu_add" 
    /> 

    <ImageView android:id="@+id/cloudBG" 
     android:layout_centerInParent="true" 
     android:layout_width="230dp" 
     android:layout_height="60dp" 
     android:background="@drawable/cl" 

    /> 

    <ImageView 
     android:id="@+id/footer_divider" 
     android:layout_width="fill_parent" 
     android:layout_height="2dp" 
     android:background="@android:drawable/divider_horizontal_bright" 
     android:layout_above="@id/cloudBG" 
    /> 


    </RelativeLayout> 

<com.commonsware.cwac.tlv.TouchListView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tlv="http://schemas.android.com/apk/res/com.commonsware.cwac.tlv.demo" 

    android:id="@android:id/list" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/root" 
    android_layout_above="@id/footer_cloud" 
    android:drawSelectorOnTop="false" 
    android:listSelector="@android:color/transparent" 

    tlv:normal_height="64dip" 
    tlv:grabber="@+id/icon" 
    tlv:remove_mode="slideLeft" 

/> 

</RelativeLayout> 

私はCommonswareのtouchlistviewを使用していますが、それはうまくいかない理由ではないと思います。誰もが間違いを見つけられますか?

また、実装した仕切りが見えません。 background属性またはsrc属性を使用する場合でも、エフェクトは表示されません。

+0

このサイトのリストの高さは0dpです:http://blog.maxaller.name/2010/05/attaching-a-sticky-headerfooter-to-an-android-listview/ リストは見えません。それは方法でArrayAdapterを満たされている –

答えて

0

まず、問題を可能な限り診断する際に、より簡単なウィジェットに戻ってください。 TouchListViewと奇妙なことがある場合は、通常のListViewを試してみてください。

第2に、TouchListViewのレイアウトルールが奇妙です。ウィジェットを独自のコンテナの下に作成しようとしています。そして、高さは0dpでなければなりません。

これらのことを試してください。問題がまだ発生していて、TouchListViewに固有の場合は、さらに調査するためにエラーを再現するサンプルプロジェクトが必要になります。問題が通常のListViewで発生し、ここで書いたことが役に立たない場合は、階層ビューを使用してレイアウトに問題があるかどうかを診断することです。

+0

提案をありがとう。私はリストの高さを0dpに変更し、touchlistviewをlistviewに置き換えました。何も変わっていないと、私は階層ビューアを試しました。私はid/rootの3人の子供、すなわちリスト、フッタ、背景のイメージビューに気づいた。私は背景が問題かもしれないと思ったので、削除しましたが効果はありませんでした。ルートには2人の子供がいます。フッターはalignparentbottomを持ち、リストは上記にあります:フッター –

関連する問題