Black bars with HDMI adapter on iPad 2

My application supports HDMI output.

I asked for a code for the resolution of the TV and got 1920 x 1080 px for

externalScreen.bounds

Ok, everything is fine. I adjusted my views and tried them on TV ...

BUT: There were black bars on the bottom / top / sides of the screen, although the TV was detected correctly, like 1920 x 1080, and my presentation is also set up correctly?

Why is the format wrong?

PS When I reflect the main screen, it also shows stripes, when I watch a video with the Youtube application, do the black bars disappear?

Thank you for your help!

Update:

OK, although I got this output in my console:

A new screen got connected: <UIScreen: 0x3439a0; bounds = {{0, 0}, {1920, 1080}}; mode = <UIScreenMode: 0x345240; size = 1920.000000 x 1080.000000>>

... I still get a black frame. I am starting to browse CGRectMake(0.0f,0.0f,1920.0f,1080.0f)for testing purposes.

, ( ):

enter image description here

+3
3
externalScreen.overscanCompensation = UIScreenOverscanCompensationInsetApplicationFrame;
+1

, 16: 9 ( 4: 3, ). , (, ). , 1920 x 1080

edit: , iPad 1920 x 1080,

- (void) screenDidConnect:(NSNotification *)aNotification
{
    NSLog(@"A new screen got connected: %@", [aNotification object]);
    //[self printScreenInfo];

    UIScreen* newScreen = [aNotification object];

    CGRect screenBounds = newScreen.bounds;

    if (!self.externalWindow)
    {
        self.externalWindow = [[UIWindow alloc] initWithFrame:screenBounds];

        self.externalWindow.screen = newScreen;
        self.externalViewController.view.frame = externalWindow.frame;

        [self.externalWindow addSubview:externalViewController.view];

        self.externalWindow.hidden = NO;
        // Set the initial UI for the window.
        // [externalViewController displaySelectionInSecondaryWindow:externalWindow];

    }
}
+4

, :

externalScreen.overscanCompensation = UIScreenOverscanCompensationInsetBounds | UIScreenOverscanCompensationInsetApplicationFrame; // this is the same as setting it to 3

UIScreenOverscanCompensationInsetApplicationFrame UIWindow.

+1
source

All Articles