试图支持Landscape orientation
,以下是绘图代码。注:aCell是UIControl
类的对象: -支持横向的UIVIEWS:
- (void)layoutCells
{
for (UIView *aCell in _cells){
if ([aCell superview] != self)
[self addSubview:aCell];
int height = [[UIScreen mainScreen] bounds].size.height;
if (height >= 568)// iPHone 5
{
CGRect cellFrame = aCell.frame;
cellFrame.size.height = 520;
[aCell setFrame:cellFrame];
[aCell setCenter:_spinCenter];
[[aCell layer] setAnchorPoint:CGPointMake(0.5, (_spinCenter.y/(self.frame.size.height+70)))];
}
else{
[aCell setCenter:_spinCenter];
CGRect frame = CGRectMake(60.f, 424.f, 200.f, 460);
[[aCell layer] setAnchorPoint:CGPointMake(0.5, _spinCenter.y/frame.size.height)];
}
// Clockifying happens with "selectCellAtIndex:animated:".
}
}
在这里,你去试试这个链接。它说明了如何 [如何改变横向到纵向,反之亦然iPhone] [1] [1]:http://stackoverflow.com/a/13356988/1825557 – 2013-05-21 18:16:49