1
我需要從狀態欄頂部將表格視圖設置爲以橫向模式爲中心,但表格視圖會自動變爲水平,即從右向左。我究竟做錯了什麼?這裏是我的代碼表視圖變爲水平
- (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];
}