2016-11-11 4 views

答えて

0

私は間違ったライブラリを使用していると思います。 あなたはGradleの中で、このライブラリを使用することができます。その後、

compile 'com.roughike:bottom-bar:1.4.0.1' 

とあなたの代わりにラフハイキングのカスタマイズされた下部のナビゲーションバーを使用することができます

bottombar.useFixedMode(); 
0

を使用してみてください。

`<android.support.v7.widget.CardView 
    android:id="@+id/cvBottomNavigationBar" 
    android:layout_width="match_parent" 
    android:layout_height="48dp" 
    android:layout_alignParentBottom="true" 
    android:background="?attr/selectableItemBackground" 
    app:cardCornerRadius="0dp" 
    app:cardElevation="6dp"> 

    <LinearLayout 
     android:id="@+id/tab_item_container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentBottom="true" 
     android:gravity="bottom" 
     android:orientation="horizontal"> 


     <RelativeLayout 
      android:id="@+id/tab_iv_0" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="1" 
      android:gravity="center" 
      android:padding="6dp"> 

      <ImageView 
       android:id="@+id/iv_0" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:layout_gravity="center" 
       android:clickable="false" 
       android:contentDescription="@null" 
       android:src="@drawable/home" /> 

     </RelativeLayout> 


     <RelativeLayout 
      android:id="@+id/tab_iv_1" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="1" 
      android:gravity="center" 
      android:padding="6dp"> 


      <ImageView 
       android:id="@+id/iv_1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:layout_gravity="center" 
       android:clickable="false" 
       android:contentDescription="@null" 
       android:src="@drawable/bookmark" /> 

     </RelativeLayout> 

     <RelativeLayout 
      android:id="@+id/tab_iv_2" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="1" 
      android:gravity="center" 
      android:padding="6dp"> 

      <ImageView 
       android:id="@+id/iv_2" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:layout_gravity="center" 
       android:clickable="false" 
       android:contentDescription="@null" 
       android:src="@drawable/profile" /> 

     </RelativeLayout> 
    </LinearLayout> 
</android.support.v7.widget.CardView>` 
関連する問題