andrewgubanov/OrientedTableView — Issue #2: View isn't resized correctly
Author: brad-goss
Created: 2011-10-14 14:39:26+00:00
State: open

Hi, i've recoded the setTableViewOrientation method to properly resize the view... It's pretty straight forward.

- (void)setTableViewOrientation:(AGTableViewOrientation)anOrientation
{
if (_tableViewOrientation != anOrientation)
{
_tableViewOrientation = anOrientation;
CGFloat angle = 0.0;
if (_tableViewOrientation == kAGTableViewOrientationHorizontal)
{
CGRect frame = self.frame; // save the frame
angle = -M_PI/2.0;
self.transform = CGAffineTransformMakeRotation(angle); // commit the transform
super.frame = frame; // now apply the old frame. voila, it's properly placed and sized.
}
[self reloadData];
}
}