Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:44:27+00:00 2026-05-31T15:44:27+00:00

I am using the PhoneGap ExternalScreen plugin, but I have modified it slightly to

  • 0

I am using the PhoneGap ExternalScreen plugin, but I have modified it slightly to be able to support multiple resolutions. I got some tips from Matt Gemmel’s post on iPadVGAOutput (http://mattgemmell.com/2010/06/01/ipad-vga-output/) Here is what my code looks like:

- (void) toggleResolution:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
    self.callbackID = [arguments pop];
    if ([[UIScreen screens] count] > 1){
        externalScreen = [[[UIScreen screens] objectAtIndex:1] retain];
        screenModes = [externalScreen.availableModes retain];
        UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"External Display Size"
                                                    message:@"Choose a size for the external display."
                                                    delegate:self
                                                    cancelButtonTitle:nil
                                                    otherButtonTitles:nil] autorelease];

        for (UIScreenMode *mode in screenModes){
            CGSize modeScreenSize = mode.size;
            [alert addButtonWithTitle:[NSString stringWithFormat:@"%.0f x %.0f pixels", modeScreenSize.width, modeScreenSize.height]];
        }
        [alert show];
    } else {
        PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_ERROR messageAsString:WEBVIEW_UNAVAILABLE];
        [self writeJavascript: [pluginResult toErrorCallbackString:self.callbackID]];
    }    
}



- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    UIScreenMode *desiredMode = [screenModes objectAtIndex:buttonIndex];
    externalScreen.currentMode = desiredMode;
    externalWindow.screen = externalScreen;    
    [screenModes release];

    CGRect rect = CGRectZero;
    rect.size = desiredMode.size;
    externalWindow.frame = rect;
    externalWindow.clipsToBounds = YES;

    externalWindow.hidden = NO;
    [externalWindow makeKeyAndVisible];

    PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK messageAsString:WEBVIEW_OK];
    [self writeJavascript: [pluginResult toSuccessCallbackString:self.callbackID]];
}

The resolution is changing just fine, but the content is not being constrained inside of the correct dimensions. An example is as follows:

When the second screen is originally loaded (at 1920×1080), it looks like this: http://cl.ly/F5IV

After changing the resolution to 1280×720, it looks like this: http://cl.ly/F41K

I am relatively new to Objective-C, but am quickly picking it up. Any pointers on solving my problem and/or improving the code altogether would be great. Thanks!

Andrew

EDIT: I also wanted to clarify, I am not manually setting any width/height on any of the views and/or CSS that is being displayed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:44:28+00:00Added an answer on May 31, 2026 at 3:44 pm

    Since no one found it, I started to dig into the Objective-C and solved it. I had to add the following to the alertView method:

    webView.frame = rect;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the ExternalScreen plugin for phonegap, and I am loading a 'local'
I have mobile app written in HTML5 using PhoneGap. Some parts of the app
I am using phonegap for IOS. I created a Plugin to unzip files. But
I am developing application using phonegap in eclipse for android .I have created folder
I am using phonegap in my application. using camera plugin for capture and select
Note- even though im using phonegap, the question is not about some issue in
I'm using phonegap to create mobile app. I don't want to have everything in
I am using PhoneGap, jQuery mobile in Xcode. I have a local xml (data.xml)
I have been using phonegap.js with jqm to built a mobile android app. I
We're currently using PhoneGap for our mobile applications, and I know they have device.udid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.