Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gap between certain digits like 1 #38

Open
Rahul-Vignesh opened this issue Mar 15, 2022 · 7 comments
Open

Gap between certain digits like 1 #38

Rahul-Vignesh opened this issue Mar 15, 2022 · 7 comments

Comments

@Rahul-Vignesh
Copy link

Rahul-Vignesh commented Mar 15, 2022

image

As you can see in the above screenshot, there is a visible gap between 1 and 0 which is odd. How can I fix it?

Occurs in both IOS and android devices.

@Rahul-Vignesh Rahul-Vignesh changed the title [IOS] Gap between certain digits like 1 Gap between certain digits like 1 Mar 15, 2022
@vitaliyirtlach
Copy link

Have same issue too.

@heyman333
Copy link
Owner

I'm sorry but i cannot spend any time on this project for the next few months
So it would be helpful if you can find a solution. 😹

@tsachit
Copy link

tsachit commented May 9, 2022

image

As you can see in the above screenshot, there is a visible gap between 1 and 0 which is odd. How can I fix it?

Occurs in both IOS and android devices.

This is because there is 0-9 in every digit place, just hidden. I believe a static width is defined for every digit place, so every number, fat or thin, fits inside that width. So probably that's why there is this gap. I had to remove this package just because of that. But If anyone can find a way where width are adjusted dynamically then it'd solve it for all of us

@nechmads
Copy link

nechmads commented Jul 4, 2022

Same problem here... hard to understand from the code how to fix it :(

@mherda
Copy link

mherda commented Aug 29, 2022

What you can do is specify fontVariant: ['tabular-nums'] in the fontStyle prop. For example:

 pointsCounter: {
    fontSize: 42,
    fontWeight: 'bold',
    fontVariant: ['tabular-nums'],
  },

It'll align the digits in a more consistent way.

@Huguet57
Copy link

What you can do is specify fontVariant: ['tabular-nums'] in the fontStyle prop. For example:

 pointsCounter: {
    fontSize: 42,
    fontWeight: 'bold',
    fontVariant: ['tabular-nums'],
  },

It'll align the digits in a more consistent way.

Great response. Maybe this should be made the default?

@munishantier
Copy link

<View key={index} style={{ height, width: Platform.OS == "android" ? n == 1 ? 16 : "auto" : n == 1 ? 18 : "auto", overflow: 'hidden' }}> <Animated.View style={[ { transform: [ { translateY: animations[index]!, }, ], marginHorizontal: n == 1 ? -2 : 0 }, ]} > {NUMBERS.map((number, i) => ( <Text style={StyleSheet.flatten([ fontStyle, { height }, ])} key={i} > {number} </Text> ))} </Animated.View> </View>
Working fine by adding width and marginHorizontal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants