question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UIManager.measure dose not work on Android

See original GitHub issue

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,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
radko93commented, 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)

1reaction
maheshaarkeneacommented, Sep 25, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native UIManager.measureInWindow coords to android ...
What i need to do, is to get the coordinates of a view in react native to be able to use the same...
Read more >
Prerequisites for Libraries - React Native
The following steps will help ensure your modules and components are ready for the New Architecture.
Read more >
UiModeManager - Android Developers
Constant for setNightMode(int) and getNightMode() : never run in night mode. ... for a car dock application that does not require the screen...
Read more >
Дмитрий Пацура Piter
https://github.com/SoftwareMansion/jsc-android-buildscripts ... or React DOM, and does not follow the common versioning scheme. ... UIManager.measure.
Read more >
Adventures with React Native - Matt Zabriskie
I had a finished working version for both iOS and Android in about ... import the UIManager from NativeModules , manually measure the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found