Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 反应本机转换原点_Css_Reactjs_React Native_Transform - Fatal编程技术网

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});
};

似乎还不支持变换原点,并且