0
我有一個UIViewController
與TableView
這是顯示當我按Button
在另一個View
。它從屏幕底部正確滑動,但我希望它的高度爲屏幕高度的一半,並停留在屏幕的底部。更改高度的UIView
我怎樣才能得到這個?
這裏是我的代碼:
CupsViewController
這是代碼當按下用於顯示TableView
Button
。
//DirectionViewController is the one that contains TableView
DirectionViewController *directionController = [self.storyboard instantiateViewControllerWithIdentifier:@"directionsView"];
// Position the options at bottom of screen
CGRect optionsFrame = directionController.view.frame;
optionsFrame.origin.x = 0;
optionsFrame.size.width = 320;
optionsFrame.origin.y = 423;
// For the animation, move the view up by its own height.
optionsFrame.origin.y += optionsFrame.size.height;
directionController.view.frame = optionsFrame;
[UIView beginAnimations:nil context:nil];
optionsFrame.origin.y -= optionsFrame.size.height;
directionController.view.frame = optionsFrame;
[UIView commitAnimations];
[self.navigationController pushViewController:directionController animated:YES];
它什麼都不做.. – Lyd
我希望它留在屏幕的底部了。 – Lyd
你可以檢查GITHUB的項目,看看你正在嘗試做什麼嗎? – slysid