Css 反应本机转换原点
如何将Css 反应本机转换原点,css,reactjs,react-native,transform,Css,Reactjs,React Native,Transform,如何将transform origin属性应用于react native中的样式? 我试过几种方法,但都没有成功 我试过: transform: [{ rotate: ('90deg')},{origin: {x: 'top', y:'center'}} ] React native尚未具有任何变换原点属性。也许在将来 但是通过一个技巧我们可以实现这一点我制作了一个库来实现变换原点 在CSS中提供转换原点、iOS中的定位点、Android中的轴心点等功能 易于使用 import { withA
transform origin
属性应用于react native中的样式?
我试过几种方法,但都没有成功
我试过:
transform: [{ rotate: ('90deg')},{origin: {x: 'top', y:'center'}} ]
React native尚未具有任何变换原点属性。也许在将来
但是通过一个技巧我们可以实现这一点我制作了一个库来实现
变换原点
在CSS中提供转换原点、iOS中的定位点、Android中的轴心点等功能
易于使用
import { withAnchorPoint } from 'react-native-anchor-point';
getTransform = () => {
let transform = {
transform: [{ perspective: 400 }, { rotateX: rotateValue }],
};
return withAnchorPoint(transform, { x: 0, y: 0.5 }, { width: CARD_WIDTH, height: CARD_HEIGHT });
};
<Animated.View style={[styles.blockBlue, this.getTransform()]} />
从“react native锚点”导入{withAnchorPoint};
getTransform=()=>{
让变换={
转换:[{perspective:400},{rotateX:rotateValue}],
};
返回withancorpoint(转换,{x:0,y:0.5},{width:CARD\u width,height:CARD\u height});
};
似乎还不支持变换原点,并且