One thing, multiple cards!?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: One thing, multiple cards!?

Post by DevBoyLars » Mon Sep 22, 2014 6:31 pm

I found a solution for the "label-problem". I let the stack control the card-objects.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: One thing, multiple cards!?

Post by jacque » Mon Sep 22, 2014 10:13 pm

The way I did it for iOS was to import high-density images into the stack. I sized my stack to fit non-Retina devices and set all the images to 50% size. (Set the lockloc of the images to true so they won't change.) Then I laid out the rest of the card to work on non-retina devices. I set the fullscreenmode to empty so that iOS would do the resizing. When the app opens on a retina device, iOS doubles everything and because the images are high-density they retain good appearance. I didn't need to create multiple cards, it just worked. It looked the same on both iPhones and iPads because they both have the same proportions.

For Android I did the same thing, but set fullscreenmode to "noBorder" and made the stack somewhat larger than my target device size. I set the backpattern of the card to match my main background image. NoBorder shows the entire card while retaining the ratio, so on smaller devices there was very little border, and on larger devices there was more border. But regardless of how much border was showing, it matched the background of my app and looked okay, and the controls on the card resized proportionally to fit the screen area. This way I didn't need to create different cards for every resolution, LC did all the work.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: One thing, multiple cards!?

Post by DevBoyLars » Tue Sep 23, 2014 11:48 am

Ok, but with this solution you get the following problems in business-apps:

1) oversizes controls on any iPad/tablet
2) your control-postions can never match the real positions of the OS (just think about an iPhone 4 and iPhone 5: In your way the controls goes out of position on iPhone 5 after auto-scale)

So the only way to get the right look for every device is still to use multiple cards or use altMobileResizer - and that's really bad.

Post Reply