I have BottomNavigationView
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
app:itemTextColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
android:background="?android:attr/windowBackground"
android:foreground="?attr/selectableItemBackground"
app:itemIconTint="@android:color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/navigation" />
when I use default styles
in manifest everything is ok:
<application
android:name=".model.MyApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
When I override default styles
like this
<style name="base" parent="Theme.AppCompat.Light.NoActionBar" >
<item name="android:background">@color/grey_dark_bg_md</item>
<item name="android:textColor">@color/white</item>
</style>
and manifest:
<application
android:name=".model.MyApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/base">
<activity
android
I get problems. Non active bottom navigation images cuts
whats wrong with styles?
You can set style for BottomNavigationView as below:
<style name="BottomNavigation">
<item name="android:background">@color/indigo</item>
<item name="itemBackground">@drawable/navigation_bar_item_bg</item>
<item name="itemIconTint">@color/navigation_bar_txt_color</item>
<item name="itemTextColor">@color/navigation_bar_txt_color</item>
<item name="paddingStart">@dimen/bottom_navigation_padding</item>
<item name="paddingEnd">@dimen/bottom_navigation_padding</item>
</style>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/bottom_navigation_menu"
style="@style/BottomNavigation"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With