Open anta40 opened 6 years ago
Hi @anta40, may be you should try having your AHBottomNavigation contained in a coordinatorLayout for best result
`<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/home_coordinator_layout_id" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/scblur">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/home_fab_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginBottom="64dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_write"
android:tint="@android:color/white" />
<com.aurelhubert.ahbottomnavigation.AHBottomNavigation
android:id="@+id/home_bottom_navigation_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" />
</android.support.design.widget.CoordinatorLayout>`
@anta40 If you are using ConstraintLayout you need to use the constraint layout rules. This is my code:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.companionfree.kdmgenerator.main.MainActivity">
<com.google.android.gms.ads.AdView
android:id="@+id/main_adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/main_banner"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/bottom_navigation"/>
<FrameLayout
android:id="@+id/main_content"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/main_adView"
app:layout_constraintTop_toTopOf="parent"/>
<com.aurelhubert.ahbottomnavigation.AHBottomNavigation
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
</android.support.constraint.ConstraintLayout> `
Not really sure whether the cause of this bug is mine, or something inside AHBottomNavigation. I'll give a shot, anyway.
So, I'm using the latest AHBottomNavtion (2.2.0). It's defined in my content_main.xml
The result is, well AHBottomNavigation (Berita,Kalender,Kontak) stays on top, which is supposed to be at bottom. The full source code is provided. Feel free to give it a look :)