Selaa lähdekoodia

Fix BottomTabs background color changing to white background sometimes

For some reason, AHBottomNavigation has two background color properties - backgroundColor and defaultBackgroundColor. Sometimes the default background color is applied, which causes the BottomTabs to be colored white.

Closes #5533
Guy Carmeli 5 vuotta sitten
vanhempi
commit
57eb0db7da

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java Näytä tiedosto

@@ -64,6 +64,12 @@ public class BottomTabs extends AHBottomNavigation {
64 64
         if (getTitleState() != titleState) super.setTitleState(titleState);
65 65
     }
66 66
 
67
+    @Override
68
+    public void setBackgroundColor(int color) {
69
+        super.setBackgroundColor(color);
70
+        if (getDefaultBackgroundColor() != color) setDefaultBackgroundColor(color);
71
+    }
72
+
67 73
     public void setText(int index, String text) {
68 74
         AHBottomNavigationItem item = getItem(index);
69 75
         if (!item.getTitle(getContext()).equals(text)) {