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

UIManager.measure dose not work on Android #22443

Closed
chenyao6134 opened this issue Nov 28, 2018 · 13 comments
Closed

UIManager.measure dose not work on Android #22443

chenyao6134 opened this issue Nov 28, 2018 · 13 comments
Labels
Platform: Android Android applications. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@chenyao6134
Copy link

chenyao6134 commented Nov 28, 2018

Environment

 React Native Environment Info:
    System:
      OS: macOS 10.14.1
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 25.14 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.12.0 - /usr/local/bin/node
      Yarn: 1.12.1 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 19, 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.0, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3
        System Images: android-23 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1 
      react-native: 0.56.0 => 0.56.0 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1

Description

NativeModules.UIManager.measure(findNodeHandle(ref), (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => { 
    console.log(x,y,pageX,pageY); 
    this.scrollView && this.scrollView.scrollTo({x: 0, y: y, animated: true}) 
});

I use the UIManager.measure like this,and it can scroll to the right place on the iOS.
but on android ,the console.log result is undefined,

@react-native-bot react-native-bot added Platform: Android Android applications. Platform: iOS iOS applications. labels Nov 28, 2018
@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@radko93 radko93 changed the title UIManager.measure dose not work onandroid ,but it work fine os iOS12 simulator UIManager.measure dose not work on Android Nov 28, 2018
@radko93
Copy link
Contributor

radko93 commented Nov 28, 2018

Please reproduce the issue with the latest React Native version.

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@chenyao6134
Copy link
Author

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

I have paste the react-native info under the Environment tag,and I could not found anything about this issue.

@chenyao6134
Copy link
Author

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@radko93
Copy link
Contributor

radko93 commented Nov 29, 2018

Did you tried with latest RN version?

@chenyao6134
Copy link
Author

Did you tried with latest RN version?

YES,it worked,thank you very much. And it also work fine on the react-native 0.56 demo,

@radko93
Copy link
Contributor

radko93 commented Dec 4, 2018

I'm closing this then.

@radko93 radko93 closed this as completed Dec 4, 2018
@itxuye
Copy link

itxuye commented Jun 13, 2019

UIManager.measure still dose not work on Android with React Native 0.59

@kevtran410
Copy link

i'm facing this issue, setTimeOut to UIManager.measure make it works but sometimes, it returns wrong values.

@sinhpn92
Copy link

I have same issue in react native version 0.59.9 :v

@maheshaarkenea
Copy link

same issue on react native version 0.59.9. any solution would be great. tried using collapsable={false} on the view i am measuring and also tried using onLayout={() => {}) on the same view as per the solutions provided in responses of similar issues. no luck yet. at the same time this works on another react native project. no idea why its not working here.

@radko93
Copy link
Contributor

radko93 commented Sep 30, 2019

We won't be able to fix that on 0.59.x, but if you can reproduce that issue on 0.61.x please open another issue and then maybe you will be able to patch it)

@facebook facebook locked as resolved and limited conversation to collaborators Dec 4, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants