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.

negative value of property transform doesn't work on some android 7.0 devices.

See original GitHub issue

RN version: “0.41.2” devices: FRD-AL10(honor 8) EMUI:5.0 android: 7.0 MHA-AL00(Mate9) EMUI:5.0 android:7.0

On some android device mentioned before , negative value of transform(e.g… scaleX scaleY ) doesn’t work. i found this problem when i’m using the package of react-native-invertible-scroll-view. It write like this:

let styles = StyleSheet.create({
  verticallyInverted: {
    flex: 1,
    transform: [
      { scaleY: -1 },
    ],
  },
  horizontallyInverted: {
    flex: 1,
    transform: [
      { scaleX: -1 },
    ],
  },
});

but when i use scaleY which is deprecated directly, like this:

let styles = StyleSheet.create({
  verticallyInverted: Platform.select({
    ios: {transform: [{ scaleY: -1 }]},
    android: {scaleY: -1},
  }),
  horizontallyInverted: Platform.select({
    ios: {transform: [{ scaleX: -1 }]},
    android: {scaleX: -1},
  }),
});

it worked!
Guess there is some thing wrong when get property from transform in native code, Any ideas how does this fix?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
yurycommented, Jun 14, 2017

Confirm at RN 0.43.2 Huawei OS7.0 P10. VTR-L09/VTR-L29

Doesn’t work with transform, works with deprecated.

1reaction
ptomasrooscommented, Jun 15, 2017

This is a real case reported by various user by us as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Force correct CSS3 transform percentage interpretation on ...
I am using Android 2.3 and can't produce the exact problem you describe (with regards to your comment "-100% somehow refers to the...
Read more >
Sensors Overview | Android Developers
Most Android-powered devices have built-in sensors that measure motion, orientation, and various environmental conditions. These sensors are capable of ...
Read more >
Android Studio 2021.2.1 Closed Issues
Android studio 2021.1.1 beta5 . Gradle sync fails with "Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.".
Read more >
Android Studio 2022.1.1 Closed Issues
[R8 3.3.68] Crash on some Android 6 devices after upgrading from R8 3.2. Issue #258270051 ... Regression in EE: Extracting a method sometimes...
Read more >
MotionEvent - Android Developers
The axis values describe the position and other movement properties. ... Some devices can report multiple movement traces at the same time.
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