0
我有一個自定義視圖滾動型。現在我與旋轉有問題,認爲有旋轉後不正確的幀POS /大小。UIScrollView的自定義視圖旋轉問題
我如何可以調用CustomView旋轉後的重新定位和調整框架和內容?
- (void)setupPage
{
NSUInteger nimages = 0;
CGFloat cx = 0;
for (; ; nimages++) {
if (nimages == list.count) {
break;
}
CustomStepView *stepView = [[CustomStepView alloc] initWithFrame:CGRectZero];
stepView.tag = nimages;
if([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown)
{
stepView.frame = CGRectMake(cx, 0.0 , 768.0f, 926.0f);
cx += 768.0;
}
else
{
stepView.frame = CGRectMake(cx, 0.0 , 1024.0f, 670.0f);
cx += 1024.0;
}
[scrollView addSubview:stepView];
[stepView release];
}
self.pageControl.numberOfPages = nimages;
}
你不應該改變內部框架' - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation'。你在'-will ...'或'-did ...'方法中進行了修改。 – mahboudz 2012-09-13 18:55:50