react-native 踩到坑之 transform skewX skewY
来源:互联网 发布:数据价值网 邹志飞 编辑:程序博客网 时间:2024/06/10 17:19
提示,本文不能解决问题,但作为一个坑的记录,经验教训。
rn版本 0.46
众所周知,transform是用来变换视图的属性,
经实践,transform各个属性在ios平台上运行良好,安卓上的表现与ios不一致。
比较严重的是在安卓上skewX、skewY比较扯蛋,skewX不能用,skewY居然是旋转效果……
经探索谷歌、github,发现,此问题可能暂时得不到解决,rn代码贡献者MaxGraey提到:
I confirm, for Android skew transform is not working.
我确认,无法工作
Digging deep in ReactAndroid's sources I found the following:
Code to transform the view is made very inefficient. In order to apply transformation matrix firstly decompose to scale/rotate/skew/translation and applied separately to view.setTranslationX, view.setTranslationY and etc.Android's view does't has methods for setSkewX and setSkewY at all. "setMatrix" absent as well!
So I see only two ways:
- Use view's setAnimationMatrix.
- Subclassing View to obtain direct access to private mRenderNode and his matrix property.
Both way need hard refactoring existing code
看来只有两种方法:
1.设定视图的动画矩阵功能
2.继承视图,获得私有的mRenderNode节点并用它的矩阵属性
大神提到,两种方法都很困难。
skewX skewY 这个坑绕过吧。用rotate等多个拼合的方法代替。
阅读全文
0 0
- react-native 踩到坑之 transform skewX skewY
- [Egret学习笔记 七]使用skewX skewY实现图片翻转效果
- React-native View组件transform样式
- 【React Native】之Native Modules
- React Native]React Native组件之Navigator
- react-native之初识react-native
- react native之helloworld
- React Native之序言
- React Native之样式
- React Native之hellWord
- React native 之 tabbarIos
- React Native之Navigator
- React Native 之 安装
- React Native 之 教程
- React Native 之 Props
- React Native 之 State
- React Native 之 Style
- React Native 之 Networking
- 轻量级的int-object键值对——SparseArray
- Python从数据库取数,对时间进行处理,统计数据汇总后画图
- java.util.ConcurrentModificationException 异常解析
- JavaScript隔行换色
- 循环嵌套应用实例(四角星星,菱形)
- react-native 踩到坑之 transform skewX skewY
- mybatis 报错 java.io.IOException: Could not find resource mybatis-config.xml
- 微信小程序 电影列表页(十三)
- CRF++的使用 CRF用于中文分词
- win7中navicat如何连接VMware中linux中的msyql
- 特征分解条件
- 了解
- 1004. Counting Leaves (30)
- 2017.7.31 SN号与tls测试