2017-04-06 6 views
0

リニアレイアウトはこれですでBottomNavigationMenuとリストビュー: 私は が含まれている活性を有する - 債権債務を示すために少し断片を、それが の作品 - すべての私の支出を持つリストビューと同様に動作します。 - 部分的に動作するbottomNavigationMenuBar実際には私の活動の底に固定されていませんが、ListViewがディスプレイ上のすべてのスペースを占有するまでアンドロイド - 私は私のBottomNavigationBar</p> <p>状況に奇妙な問題を抱えている

よく説明するために画面を添付します no good behaviour, it must stay at the bottom なし良い振る舞い、それは下
enter image description here ListViewコントロールに滞在しなければならないことは、画面よりも大きいと、それは良い作品ここ

は私のXMLである

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/tab_bck" 
    xmlns:design="http://schemas.android.com/apk/res-auto"> 
     <LinearLayout 
      android:id="@+id/LinearVerticalLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:background="@color/tab_bck" > 

      <android.support.v7.widget.Toolbar 
       xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:app="http://schemas.android.com/apk/res-auto" 
       android:layout_width="match_parent" 
       android:id="@+id/expenseToolbar" 
       android:layout_height="?attr/actionBarSize" 
       android:elevation="6dp" 
       app:layout_collapseMode="pin" 
       app:layout_scrollFlags="scroll|enterAlways" 
       app:popupTheme="@style/AppTheme" 
       app:navigationIcon="?attr/homeAsUpIndicator" 
       app:titleTextColor="@android:color/white" 
       app:subtitleTextColor="@android:color/white" 
       android:background="@color/colorPrimary"> 
      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       /></android.support.v7.widget.Toolbar> 


      <FrameLayout 
       android:id="@+id/fragment" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:name="it.polito.mad17.viral.sliceapp.Fragment_of_money" 
       /> 
      <ListView 
       android:id="@+id/listView2" 
       android:layout_width="match_parent" 
       android:layout_weight="1" 
       android:layout_height="0dp" 
       android:background="@color/tab_bck" 
       android:longClickable="true" 
       /> 

      <android.support.design.widget.BottomNavigationView 

       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/bottom_nav_bar" 
       android:layout_gravity="bottom" 
       design:menu="@menu/bottom_nav_bar_menu" 
       design:itemIconTint="#16a085" 
       design:itemTextColor="#16a085"/> 

     </LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 
+0

利用RelativeLayoutの代わりのLinearLayout – Sach

答えて

0

あなたのBottomBarを線形レイアウトの外に置きます。このように:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/tab_bck" 
    xmlns:design="http://schemas.android.com/apk/res-auto"> 
     <LinearLayout 
      android:id="@+id/LinearVerticalLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:background="@color/tab_bck" > 

      <android.support.v7.widget.Toolbar 
       xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:app="http://schemas.android.com/apk/res-auto" 
       android:layout_width="match_parent" 
       android:id="@+id/expenseToolbar" 
       android:layout_height="?attr/actionBarSize" 
       android:elevation="6dp" 
       app:layout_collapseMode="pin" 
       app:layout_scrollFlags="scroll|enterAlways" 
       app:popupTheme="@style/AppTheme" 
       app:navigationIcon="?attr/homeAsUpIndicator" 
       app:titleTextColor="@android:color/white" 
       app:subtitleTextColor="@android:color/white" 
       android:background="@color/colorPrimary"> 
      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       /></android.support.v7.widget.Toolbar> 


      <FrameLayout 
       android:id="@+id/fragment" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:name="it.polito.mad17.viral.sliceapp.Fragment_of_money" 
       /> 
      <ListView 
       android:id="@+id/listView2" 
       android:layout_width="match_parent" 
       android:layout_weight="1" 
       android:layout_height="0dp" 
       android:background="@color/tab_bck" 
       android:longClickable="true" 
       /> 
</LinearLayout> 
      <android.support.design.widget.BottomNavigationView 

       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/bottom_nav_bar" 
       android:layout_gravity="bottom" 
       design:menu="@menu/bottom_nav_bar_menu" 
       design:itemIconTint="#16a085" 
       design:itemTextColor="#16a085"/> 


</android.support.design.widget.CoordinatorLayout> 

これはあなたのために

+0

を消えます。それをチェックして、@ Kalos92 –

+0

が部分的に動作するかどうかを教えてください。問題はListViewがすべての画面を閉塞しているときに最後に表示されるアイテムがBottomNavigationBar – Kalos92

+0

の下に来るようにして、 '60dp'リニアレイアウトタグで余白の下に「60dp」を追加します。このように: 'android:layout_marginBottom =" 60dp' –

0

LinearVerticalLayoutのAndroidを与えてみてください。layout_height = "match_parent"、それは動作するかもしれません

+0

を動作するはずがない、私の活動のすべての項目は、それが私の側で働い – Kalos92

関連する問題