React Native - Change background color in tabnavigator dynamically

后端 未结 3 1545
孤城傲影
孤城傲影 2021-01-06 15:33

i want to change my tab navigator background color dynamically in based on my API response so below is my code

_TabNavigator.js

cons         


        
3条回答
  •  再見小時候
    2021-01-06 16:22

    try using

    const tabBarOptions = {
    // setting height 'null', and top 0 will change the color of pressed tab
       indicatorStyle: {
         height: null,
         top: 0,
         backgroundColor: "red",
         borderBottomColor: "black",
         borderBottomWidth: 3,
       },
       activeTintColor: "black",
       pressColor: "white",
       style: {
         backgroundColor: "#ddc8be",
       },
       labelStyle: { fontSize: 13 },
    };
    

提交回复
热议问题