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.

[Android] skew transform not working

See original GitHub issue

Steps To Reproduce

  1. Try to set skewX for View component: transforms: [{ skewX: '45deg' }}
  2. Doesn’t change the skew of View on Android (works on iOS)

Describe what you expected to happen:

Basically skewX doesn’t apply any skew on the view on Android. Here is comparison between iOS/Android:

also skewY doesn’t render same as on iOS (which looks more correct) Screenshot 2020-01-02 at 2 13 00 PM

React Native version:

System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.50 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    Yarn: 1.19.1 - ~/.yarn/bin/yarn
    npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 25, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5

Related issues

Snack demo

https://snack.expo.io/@usrbowe2/e9b920

Resources

In case anyone interested, here is the source code for skew code:

  1. This is called for SkewX: MatrixMathHelper.applySkewX(helperMatrix, convertToRadians(transform, transformType)); in file: Libraries/StyleSheet/processTransform.js
  2. Which laters uses this matrix helper to apply transformation: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:22
  • Comments:19

github_iconTop GitHub Comments

11reactions
MarekJavurekcommented, Jan 3, 2020

This is real problem!

4reactions
rvuyyuru1commented, Jul 18, 2022

still not wroking… any solution ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transform is not working for android but works for ios- rect ...
I am using react:16.0.0-beta.5 and react-native: 0.49.3, trying to rotate my graph on 180 degrees but when I pass transform in my style, ......
Read more >
The 10-min React Native Skew & Tween Transforms - YouTube
In this video, we showcase the decompose2d and tween function from redash Source code: ...
Read more >
skew() - CSS: Cascading Style Sheets - MDN Web Docs
The skew() CSS function defines a transformation that skews an element on the 2D plane. Its result is a <transform-function> data type.
Read more >
[Android] skew transform not working -
[Android] skew transform not working. ... Try to set skewX for View component: transforms: [{ skewX: '45deg' }}; Doesn't change the skew of...
Read more >
Transforms
However, once you apply transforms, the layouts remain the same around the transformed component hence it might overlap with the nearby ...
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