在屏幕下方添加UIView

时间:2010-09-29 18:54:40

标签: iphone objective-c xcode ipad

我有一个UIViewController使用addSubview添加在另一个UIViewController的顶部。我希望添加的视图可以在屏幕下方挂出,以便在需要时使用漂亮的动画进行调用。

有没有办法将子视图添加到某个位置的屏幕?

1 个答案:

答案 0 :(得分:1)

您可以修改其.frame属性,例如

[self.view addSubview:theView];
CGRect newFrame = theView.frame;
newFrame.origin.y = self.view.bounds.size.height;
theView.frame = newFrame;