Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically mimic 2x mode (or double scale) of iPhone apps on iPads?

Our iPhone app, built with PhoneGap, is published as a Universal app. The Universal setting is required for app discovery on iPads and for the execution of certain PhoneGap plugins.

We tweaked a few height and width settings, but the scale is too small for some users.

We don't have the capacity to re-code the app and recreate assets for optimal rendering on iPads.

Instead, we would like to mimic the 2x mode available on iPads -- but only on iPads. 2x mode was available when the app was iPhone-only, but the option is obviously gone now that it's a Universal app.

Is there a way to invoke this functionality, either through HTML/CSS/JS or through Objective-C?

Thanks!

like image 764
Crashalot Avatar asked Nov 01 '22 09:11

Crashalot


1 Answers

I think that you want to scale up UI elements, and not the contents. For example, if you set UIImageView frame as { 0, 0, 100, 100 }, then on iPad it'll still have frame as { 0, 0, 100, 100 } and will look too small. What you want to do is to have separate XIB files for iPhone and iPad. In this way you'll be able to create UIView frames according to the platform.

At runtime iOS will choose appropriate XIB file for current platform. Here you'll be able to find some documentation about how it works.

Here you can see an example of that:

enter image description here

like image 166
art-divin Avatar answered Nov 11 '22 06:11

art-divin