我使用以下命令将 UIView 从其原始位置移动到我的 XIB/Storyboard 上:-(void)myMovingViewAction{
[UIView animateWithDuration:.15
animations:^{
[theView setFrame:CGRectMake(0, 40, theView.frame.size.width, theView.frame.size.height)];
}
];
}
我遇到的问题是让 UIView 回到我的 Storyboard UIViewController/XIB 上的原始位置。
我知道我可以使用与上面相同的代码,其中包含原始坐标,但是这些坐标在不同的设备上是不同的。在这个例子中,约束让我的 UIView 紧贴我的 UIViewController 底部的原始位置。
有没有办法可以将此视图发送回“默认”位置?
提前致谢!:)