【问题标题】:Animated stretch of an image frame (iPhone)图像帧的动画拉伸 (iPhone)
【发布时间】:2010-09-21 21:16:59
【问题描述】:

因此,我尝试在淡入时为从零宽度拉伸到全尺寸的图像设置动画。淡入效果很好,但无论出于何种原因,该东西在动画开始时出现在全帧,而不是随着阿尔法效应的发生而增长。我的代码如下:

[UIView beginAnimations:@"FadeButtons" context:nil];
[UIView setAnimationDuration:.9];
[UIView setAnimationDelay:0.300];
batteryLife.alpha = 1;
batteryLife.frame = CGRectMake(40, 71, 240, 128);
[UIView commitAnimations];

对以动画方式更改帧有什么建议吗?我不想缩放整个图像,我想“揭开”它。谢谢。

【问题讨论】:

    标签: iphone animation sdk uiimageview scale


    【解决方案1】:

    也许框架在 beginAnimations 之前就已经是那个大小了?尝试将 beginAnimations 之前的帧设置为较小的尺寸,例如 batteryLife.frame = CGRectMake(40, 71, 0, 128);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-29
      • 2011-01-22
      • 1970-01-01
      • 2021-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多