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

Strange results in two different emulators #81

Open
CodeByRahulSaini opened this issue Jun 1, 2020 · 3 comments
Open

Strange results in two different emulators #81

CodeByRahulSaini opened this issue Jun 1, 2020 · 3 comments

Comments

@CodeByRahulSaini
Copy link

Hey, first of all thanks for this awesome package.

I am getting a strange result on two different emulators with the same code.

Another strange thing is when I remove flexWrap: 'wrap', property then design looks the same in both devices with no issue

Any suggestions on how to solve it?

Pixel XL Emulator
Screenshot_1590995791

Nexus 4 Emulator
Screenshot_1590995793

Here is my code:

const item = {
      backgroundColor: 'green',
      width: wp('28%'),
      height: wp('28%'),
      margin: wp('1%'),
    }`

   render(){ return (
      <Fragment>
        <View
          style={{
            backgroundColor: 'red',
            flex: 1,
            flexDirection: 'row',
            margin: wp('5%'),
            marginTop: wp('10%'),
            flexWrap: 'wrap',
          }}
        >
          <View style={item} />
          <View style={item} />
          <View style={item} />
        </View></Fragment>)
}
@cvlos
Copy link

cvlos commented Jun 12, 2020

Hello @IMRahulSaini , the behavior you are explaining is exactly what you would expect from flexWrap property. This may help https://reactnative.dev/docs/flexbox#flex-wrap

@CodeByRahulSaini
Copy link
Author

Actually my point is if I am using 'wp()' everywhere means some responsive value, then both emulators should show content equally i.e. three boxes in a line

@mir1198yusuf
Copy link

It seems wrong value for width is being returned by emulator. Might be emulator error instead of library error.
Can you log the width of both emulators & check if that's correct ?

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

3 participants