我需要在横向模式下将表格视图从状态栏顶部设置为中心,但表格视图会自动转向水平,即从右到左开始。我究竟做错了什么?这是我的代码
- (IBAction)pressToGetTableview:(id)sender
{
tableViewhavingOptions.frame =self.view.frame;
tableViewhavingOptions.center = CGPointMake(self.view.center.x -
CGRectGetWidth(self.view.frame), self.view.center.y );
[self.view.superview addSubview: tableViewhavingOptions];
[UIView beginAnimations: nil context: NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate: self];
[UIView setAnimationDidStopSelector: @selector(pushAnimationDidStop:finished:context:)];
tableViewhavingOptions.center = self.view.center;
self.view.center = CGPointMake(self.view.center.x + CGRectGetWidth(self.view.frame), self.view.center.y );
[UIView commitAnimations];
}