2016-10-16 11 views
-1

私はリストビュー、ツールバー、ボトムナビゲーションバーを持っています。ナビゲーションバーが一番下に整列している間、ツールバーは上に揃えられます。 Listviewにアイテムを追加しない限り、うまく動作します。 5つの項目を追加すると、下の棒が消えます。私はツールバーのようにボットバーを整列させるので、それはまだそのままですか?事前にXamarinボトムバーが失われる

活動のAXML

<?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"> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 
    <include 
    android:id="@+id/toolbar" 
    layout="@layout/toolbar" /> 

    <ListView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/listv_sepet" /> 
    <include 
    android:id="@+id/toolbar_bottom" 
    layout="@layout/toolbar_bot" 
    android:layout_alignParentBottom="true"/>  

</LinearLayout> 
    </RelativeLayout> 

ボトムツールバーAXML

<?xml version="1.0" encoding="utf-8"?> 
    <android.support.v7.widget.Toolbar        xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/toolbar_bottom" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:minHeight="?attr/actionBarSize" 
android:background="?attr/colorPrimary" 
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
/> 

感謝。

+0

質問にXAMLまたはAXMLレイアウトを追加してください。 – Cheesebaron

+0

すべて完了しました –

答えて

-1

ではなく、例えばAddHeaderViewAddFooterView方法

を使用して、リストビューに結合するときに、コード内のフッタ(ヘッダ)を設定することができ、あなたのレイアウトに含まれる使用:

 listView = view.FindViewById<ListView>(Resource.Id.mylistView); 
     View headerView = View.Inflate(Activity, Resource.Layout.ListHeader, null); 
     listView.AddHeaderView(headerView); 
+1

これで問題は解決しません。 –

0

問題は、ListViewの高さをラップし、下部のツールバーの上になるように指示しないことです。

  1. 非ネスト、それは任意のネストを行うには、この場合には、本当に必要がないので、あなたのレイアウトを:

    これは簡単で固定することができます。

  2. したがって、このような何か

を上部のツールバーの下にあることをListViewコントロールを伝え、下のツールバー上で:

<?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"> 
    <include 
     android:id="@+id/toolbar" 
     android:layout_alignParentTop="true" 
     layout="@layout/toolbar" /> 

    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_below="@+id/toolbar" 
     android:layout_above="@+id/toolbar_bottom" 
     android:id="@+id/listv_sepet" /> 

    <include 
     android:id="@+id/toolbar_bottom" 
     layout="@layout/toolbar_bot" 
     android:layout_alignParentBottom="true"/>  
</RelativeLayout> 

それを修正する必要があります。

+0

いいえ、それを修正しませんでした。下のバーは表示されません。 –

+0

おそらく私たちはparentにマッチするようにlistviewの高さを割り当てるでしょうか?だから、これをフルスクリーンに割り当てるだけで、画面の下部バーが残ってしまいます。 –

関連する問題