如何为约束更改设置动画?
问题: I'm updating an old app with an AdBannerView and when there is no ad, it slides off screen. 我正在使用 AdBannerView 更新一个旧应用,当没有广告时,它会滑出屏幕。 When there is an ad it slides on screen. 出现广告时,它会在屏幕上滑动。 Basic stuff. 基本的东西。 Old style, I set the frame in an animation block. 旧样式,我将帧设置在动画块中。 New style, I have a IBOutlet to the auto-layout constraint which determines the Y position, in this case it's distance from the bottom of the superview, and modify the constant: 新样式,我对自动布局约束有一个 IBOutlet ,它确定Y位置,在这种情况下,它是距父视图底部的距离,并修改常量: - (void)moveBannerOffScreen { [UIView animateWithDuration:5 animations:^{