0

当我按下另一个时,我有一个UIViewControllerwith which 。它从屏幕底部正确滑动,但我希望它的高度是屏幕高度的一半并保持在屏幕底部。TableViewButtonView

我怎样才能得到这个?

这是我的代码:

CupsViewController

这是Button按下显示时的代码TableView

//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];
4

1 回答 1

1

在动画代码中将选项帧高度设置为屏幕大小的一半。

希望这是您正在寻找的

https://github.com/slysid/iOS/tree/master/HalfTable

/巴拉特

于 2013-08-05T14:43:48.973 回答