1

DetailViewController ビューのみを HDMI/TV 出力に出力するように UISplitViewController をセットアップすることは可能ですか? これまでに成功せずに試みたものは次のとおりです。

if([[UIScreen screens]count] > 1){
    CGSize max;
    UIScreenMode *maxScreenMode;

    for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++)
    {
        UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i];
        if(current.size.width > max.width){
            max = current.size;
            maxScreenMode = current;
        }
    }

    UIScreen *external = [[UIScreen screens] objectAtIndex:1];
    external.currentMode = maxScreenMode;

    //set the screen of a new UIWindow to the external screen
    UIWindow *newwindow = [[UIWindow alloc] init];

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController *detailv = [storyboard instantiateViewControllerWithIdentifier:@"extern"];

    [newwindow addSubview:[detailv view]];
    newwindow.screen = external;

    [newwindow makeKeyAndVisible];
    [newwindow setHidden:NO];
}
4

0 に答える 0