CGRect框架问题

时间:2013-08-18 08:25:46

标签: uiview core-animation frame cgrect

我在iOS 7上测试时一直遇到一个反复出现的问题,我无法弄清楚它是否是一个未正确解决的BETA错误,或者是否是我的代码,或者仍然是它的配置问题。

我正在尝试动画UIView,

在我的.h我已经定义了这个

IBOutlet UIView *MainView;

@property (strong, nonatomic) IBOutlet UIView *MainView;

在我的.m中这是代码。它不是连接问题,因为不透明度(alpha)动画效果很好。

[UIView animateWithDuration:4.3 animations:^{
    [settingView.view setFrame:CGRectMake(160, 0, self.view.frame.size.width, self.view.frame.size.height)];
    MainView.alpha = 0.3;
    MainView.frame = CGRectMake(-160.0f, -40.0f, ScreenSize.size.width, ScreenSize.size.height);        
}];

有什么想法?万分感谢!

1 个答案:

答案 0 :(得分:0)

感谢@Abizern谁建议它可能受到限制。关闭约束是有效的,另一种方法是在.m

中以编程方式定义组件