2012-02-01 5 views
0

私のアプリケーションでは、ヘッダー(上部)とフッター(下部)とがあります。私はHEADER & FOOTERを固定し、スクロールしません。しかし、それらの間に配置されたListViewは、FOOTERと重複するいくつかのコンポーネントを持っています。私は何とか私のCustomListViewのそれらのコンポーネントがフッターに重ならないようにしたい。これを行う方法はありますか?リストビューにlayout_above = "@のID/options_bar":Android CustomListView他のコンポーネントをオーバーラップしています

私のレイアウトのコードは

<?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="match_parent" 
android:orientation="vertical" > 

<!-- Title Bar --> 

<include 
    android:id="@+id/title_bar" 
    android:layout_alignParentTop="true" 
    layout="@layout/title_bar" /> 

<!-- Settings Components list --> 

<ListView 
    android:id="@+id/custom_items_list" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/title_bar" 
    android:layout_weight="1" > 
</ListView> 

<!-- Options Bar --> 

<include 
    android:id="@+id/options_bar" 
    style="@style/btn_options_bar" 
    android:layout_alignParentBottom="true" 
    layout="@layout/options_bar" /> 

</RelativeLayout> 

答えて

0

私はついにこの問題を発見しました。問題は、私はうん、私はそれを試してみました

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

    <!-- Title Bar -->  
    <include 
     android:id="@+id/title_bar" 
     android:layout_alignParentTop="true" 
     layout="@layout/title_bar" /> 

    <!-- Options Bar -->  
    <include 
     android:id="@+id/options_bar" 
     android:layout_height="wrap_content" 
     android:layout_width="match_parent" 
     style="@style/btn_options_bar" 
     android:layout_alignParentBottom="true" 
     layout="@layout/options_bar" /> 

    <!-- Settings components' list -->  
    <ListView 
     android:id="@+id/custom_items_list" 
     android:layout_above="@id/options_bar" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/title_bar"> 
    </ListView> 
</RelativeLayout> 
0

below-与えられているが、あなたはアンドロイドを追加しようとしたことがありますか?これを行うには、まだ宣言されていないIDを参照していないように、レイアウトファイルのListViewよりも上になるようにフッターの宣言を移動する必要があります。しかし、オプションバーは、ListViewの前のレイアウトに表示されますが、options_bar layout_alignParentBottom = "true"のため、オプションバーはその下に表示されます。

+0

IS-XMLを更新し、興味を持っている人のために<include>

後に再度layout_heightlayout_weightを設定するために必要な(私はなぜ知らないが)、でした。しかし、この場合、ListViewも表示されません。 Logcatにもエラーはありません。 私も 'android:layout:below =" @ id/custom_item_list "'を試しましたが、運はありません。 – Rajkiran

関連する問題