ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 415 forks source link

android badgeText issue #7

Closed melihmucuk closed 6 years ago

melihmucuk commented 8 years ago

badgeText doesn't work as expected.

screen shot 2015-10-09 at 14 16 23

timzaak commented 8 years ago

+1.

ide commented 8 years ago

I'm not sure what to do about the border radius issue since I'm not sure how clipping and border radius work on Android. I'm using TabNavigator in an Android app so I will look into this in a few weeks but if you need this feature before then, I could use some help investigating potential solutions.

amibition521 commented 8 years ago

need the answer

songyouwei commented 8 years ago

+1

songyouwei commented 8 years ago

I found out a solution, your renderBadge should be like this:

      renderBadge={() =>
        this.state.badgeNum === 0? null:
        <View style={{alignItems:'center',backgroundColor:'red', width:16, borderRadius: 100, borderColor: '#d6d7da'}}>
          <Text style={{color: '#fff',fontSize:12}}>{this.state.badgeNum}</Text>
        </View>
      }
bradbyte commented 8 years ago

Thanks @songyouwei! My issue was the blue square for Android but circle on iOS. Now it's all the same.

ptomasroos commented 6 years ago

Will close since this issue is more than a year, feel free to a open a new if this is still a issue.