2010-07-30 50 views
0

HI, 我在我的iPad应用以下设置:UISplitViewController detailViewController子视图不是方向变化适当调整

UISplitViewController DetailSide-> SomeDetailViewController-> 新增子视图为[SomeDetailViewController.view addSubview:AnotherViewController。查看]

  1. 现在启动时显示“AnotherViewController视图”时,它的初始尺寸始终与最后一个方向相同(potrait/lands在界面构建器中的角度视图)我保存了该视图XIB,与当前的设备方向无关。

  2. 另外关于重新设置添加的子视图(AnotherViewController.view)的框架,即A. In - [SomeDetailViewController viewDidLoad]检查当前设备方向B.设置AnotherViewController.view的框架以匹配所需的大小。它没有适当调整其后(在XIB自动调整框中正确设置了弹簧/支柱)对方向更改。

  3. 在完成上述步骤2之后,我确实发现从底部开始AnotherViewController.view的大约一半不会响应任何触摸,看起来像是由于框架中的变化而导致响应坐标变得混乱。

  4. 我确实有“shouldAutorotateToInterfaceOrientation”实现为所有视图控制器中的所有方向返回YES。

TIA。

回答

0

在XIB中将会有一个选项来更改Inspector中的SPlitview Detail/Master。此外,如果您将其添加为子视图,则无法获取splitview委托方法,因此您需要将其添加到窗口中。尝试从窗口中删除所有元素使用

[[[[[UIAppDelegate window]子视图] objectAtIndex:0] removeFromSuperview]; self.appDelegate.splitViewControllerObject = [[UISplitViewController alloc] init];

UINavigationController * rootNav = [[UINavigationController alloc] initWithRootViewController:masterview]; UINavigationController * detailNav = [[UINavigationController alloc] initWithRootViewController:detailview];

self.appDelegate.splitViewControllerObject.viewControllers = [NSArray arrayWithObjects:rootNav, detailNav, nil]; 
    self.appDelegate.splitViewControllerObject.delegate = detailviewobj; 

    [UIAppDelegate.window addSubview:self.appDelegate.splitViewControllerObject.view]; 

好运....

0

应设置自动调整大小属性来AnotherViewController.view

AnotherViewController.view.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

相关问题