浏览代码

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 年前
父节点
当前提交
57eb0db7da
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      lib/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java 查看文件

@@ -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)) {