Sha*_* A. 3 iphone objective-c uitableview uinavigationcontroller ios
我正在调用UINavigationController并且通常允许它使用任何主要方向:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    //    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    BOOL isAllowed;
    if ([allowedOrientations isEqualToString:@"portrait"]) {
        isAllowed = (interfaceOrientation == UIInterfaceOrientationPortrait ||
                     interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
    } else if ([allowedOrientations isEqualToString:@"landscape"]) {
        isAllowed = (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
                     interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    } else {
        isAllowed = YES;
    }
    return isAllowed;
}
Run Code Online (Sandbox Code Playgroud)
从那里我调用UITableViewController:
myTable = [[SimpleDocViewerTable alloc] initWithFrame:thisFrame];
self = [super initWithRootViewController:myTable];
Run Code Online (Sandbox Code Playgroud)
哪里:
@interface SimpleDocViewerTable : UITableViewController {
Run Code Online (Sandbox Code Playgroud)
表视图控制器和导航控制器似乎大多正确集成.当我将新页面推到导航控制器上时,无论我使用哪个方向,它都会从右向左正确滚动:
SimpleDocPageVC *thisVC = [[SimpleDocPageVC alloc] initWithView:docView];
thisVC.title = [[[tableEntries objectAtIndex:indexPath.section] 
                  objectAtIndex:indexPath.row] objectForKey:@"title"];
[self.navigationController pushViewController:thisVC animated:YES];
Run Code Online (Sandbox Code Playgroud)
但是,当我退出推送页面时,如果iPhone处于横向模式,它会从下到上滚动,而不是从右到左滚动.
popViewController在生成的自动"后退"按钮中完全处理,所以它应该做正确的事情......但不是.
ser*_*gio 10
可能是你的一个控制器(SimpleDocViewerTable,或SimpleDocPageVC)不支持这两个方向shouldAutorotateToInterfaceOrientation吗?
|   归档时间:  |  
           
  |  
        
|   查看次数:  |  
           1661 次  |  
        
|   最近记录:  |