Developing iPhone app to Run on iPad - Auto Set 2x

后端 未结 2 1787
忘了有多久
忘了有多久 2021-01-19 00:13

Is there a way to programmatically set the iPad to run the iPhone app at 2x as it is launched (yet keep the iPhone app native). I understand I can create NIB files for each

相关标签:
2条回答
  • 2021-01-19 00:47

    It's not quite program control, but you can get an app to start up in 2x mode on iOS 4.2.

    I've had a couple of apps that have always started up in 2x mode, and very nice it was too, but I only worked out why this was today!

    Steps:

    1. Run iPhone app (e.g., from Xcode)
    2. Use '1x' and '2x' buttons to select desired zoom level
    3. Press home button to get back to launcher
    4. Double tap home button to bring up task manager
    5. Kill your app (hold finger down until icons start to dance, then press the '-' button on your app's icon)

    (If you ran under the debugger in step 1, Xcode will tell you the program got a SIGKILL, and might stop somewhere random in the call stack; you can ignore this.)

    Now next time you run the program, it will start up with the zoom level you selected in step 2!

    I didn't test absolutely every method of closing the program, but this preference doesn't get saved if you stop it from Xcode (e.g., using Run|Stop menu item), and it doesn't get saved if your program terminates using exit. Closing it using the launcher is the only way I've found so far...

    0 讨论(0)
  • 2021-01-19 00:51

    No. The pixel-doubling malarkey is not under your app's control, and is pretty much a crutch for apps that weren't designed for the iPad. If you didn't go nuts with specific pixel measurements in the original code, it shouldn't be difficult to move to the larger screen.

    0 讨论(0)
提交回复
热议问题