2010-09-29 65 views
0

我有一個UIViewController添加使用addSubview掛在另一個UIViewController之上。我希望添加的視圖可以掛在屏幕下方,以便在需要時使用不錯的動畫進行調用。在屏幕下方添加一個UIView

有沒有辦法在某個位置添加子視圖到屏幕上?

回答

1

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

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

完美。謝謝。 – emachine 2010-09-29 19:10:19