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 6902407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:47:39+00:00 2026-05-27T07:47:39+00:00

I am testing a piece of code on the ios simulator you get from

  • 0

I am testing a piece of code on the ios simulator you get from apple (xcode).
basically I am trying to reset the scaling when the user rotates the ipad but on the simulator it is so inconsistant. I originally had the basic code to say if orientation is 90 do this, if it is -90 do that and so on but if my original orientation is landscape or portrait it might screw up. is this behavior just with ios simulator or the same as ipad, i don’t have an ipad with me so i cannot verify

when i reset the scaling i am first removing the meta tag content all together then adding to content again because if i dont do so, it does not work at all

sample code would be, i have tried using device width, it just screws up. I dont want to use css because the content is fix width so i just need to rescale. is my method wrong? is there another tested approach? I used a switch statement before but i find the if much simpler. thank you

if (orientation == 0 || orientation == 180) {
        viewport.attr("content", "");
        viewport.attr("content", "user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, width=990px");
    }
    else {
        viewport.attr("content", "");
        viewport.attr("content", "user-scalable=no, initial-scale=0.77, minimum-scale=0.77, maximum-scale=0.77, width=990px");
    }
}
  • 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-27T07:47:40+00:00Added an answer on May 27, 2026 at 7:47 am

    The XCode simulator is pretty good and i never had problems with it besides it sometimes react a bit slow to orientation changes.

    If you would want to check it with JavaScript i think you would best try comparing the window.innerHeight to the window.innerWidth and see which one is largest.

    I made a test page a while back which uses only CSS to test for certain media query things.
    link: http://pm5544.eu/mp/
    Notice that when in landscape orientation the device width and height do not change, this was (at least to me) a bit counter-intuitive, so it might be that the iOS devices give unexpected info sometimes.

    May i ask why you don’t want to use CSS for this because it sounds like it is very doable.

    PM5544.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get my head round Unit Testing and there's one more piece
I'm having a small bit of trouble trying to get this piece of code
I am testing a piece of Python code that contains the line: from scipy
During testing, I'm stuck with testing a piece of code that receives a list
I'm looking for some style advice for testing this piece of (Objective-)C++ code, I
I have a very simple piece of code (just for testing): import smtplib import
I'm writing a unit test and the piece of code its testing requires that
I am testing this piece of code but when I run it, it does
I am trying to figure out code working for an auto testing as follows:
I was testing a piece of TPL code I wrote below. The two ManagedThreadId's

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.