Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.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
Ios UIButton将不执行CATTransformM3DMakeScale_Ios_Uibutton - Fatal编程技术网

Ios UIButton将不执行CATTransformM3DMakeScale

Ios UIButton将不执行CATTransformM3DMakeScale,ios,uibutton,Ios,Uibutton,我试图在UIButton的层上执行CATTransferM3DMakeScale,但缩放变换似乎不起作用。位置动画有效,但比例无效 [UIView animateWithDuration:animationOutDuration delay:0.0f options:UIViewAnimationOptionCurveEaseIn animations:^{ self.alpha

我试图在
UIButton的
层上执行
CATTransferM3DMakeScale
,但缩放变换似乎不起作用。位置动画有效,但比例无效

[UIView animateWithDuration:animationOutDuration delay:0.0f
                    options:UIViewAnimationOptionCurveEaseIn
                 animations:^{
                     self.alpha = 0.0f;
                     CGPoint position = self.layer.position;
                     position.y += self.bounds.size.height*animationTranslationPercentage;
                     self.layer.position = position;
                     self.layer.transform = CATransform3DMakeScale(animateOutEndScale, animateOutEndScale, 1.0f);

                } completion:^(BOOL finished) {

我编写了一些类似于您的代码,并替换了一些参数。它很好用

UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(120.0f, 20.0f, 100.0f, 50.0f)];
[button setBackgroundColor:[UIColor redColor]];
[button setTitle:@"lololo" forState:UIControlStateNormal];
[self.view addSubview:button];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [UIView animateWithDuration:1.0
                          delay:0.0f
                        options:UIViewAnimationOptionCurveEaseIn
                     animations:^{
                         button.alpha = 0.0f;
                         CGPoint position = button.layer.position;
                         position.y += button.bounds.size.height*2.0;
                         button.layer.position = position;
                         button.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.0f);

                     } completion:^(BOOL finished) {

                     }];
});
按钮向下移动、缩放和淡入


所以我猜你的
animateoutndscale
可能是1.0f

你的animateoutndscale的值是多少?所以比例是0.2f,但我意识到超级类的CATTransferm3dMakeScale也是.95f。愚蠢的错误,它的工作!