我有一个UIViewController使用addSubview添加在另一个UIViewController的顶部。我希望添加的视图可以在屏幕下方挂出,以便在需要时使用漂亮的动画进行调用。
有没有办法将子视图添加到某个位置的屏幕?
答案 0 :(得分:1)
您可以修改其.frame
属性,例如
[self.view addSubview:theView];
CGRect newFrame = theView.frame;
newFrame.origin.y = self.view.bounds.size.height;
theView.frame = newFrame;