Coding for both orientations
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Coding for both orientations
I've got an iPad app designed for one orientation (landscape) and when you turn the iPad to portrait, 30% of my graphics get cut off and the bottom of my graphic ends and shows a big empty white space. Rather than try to lock it down, I'm wondering which of the following two approaches is the best idea:
1. Use scripting to change the location of the graphisc and fields and buttons when the orientation is changed, or
2. Just extend the graphic out and sort of live with it not looking as good in portrait orientation.
Anyone looked at the best way to handle this yet?
1. Use scripting to change the location of the graphisc and fields and buttons when the orientation is changed, or
2. Just extend the graphic out and sort of live with it not looking as good in portrait orientation.
Anyone looked at the best way to handle this yet?
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Re: Coding for both orientations
I would go for option 1: script react to orientation changes, and move everything over to the best new location/size.
Unless the user interface just doesn't fit in the other orientation, you shouldn't lock the user into it.
Always design for the medium at hand...
Jan Schenkel.
Unless the user interface just doesn't fit in the other orientation, you shouldn't lock the user into it.
Always design for the medium at hand...
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Re: Coding for both orientations
Hi richardmac,
A third option is to put all your logic into a separate substack and create two cards (one for portrait and one for landscape).
Then use the orientationChanged message to switch between cards.
I use it and it works quite well.
A third option is to put all your logic into a separate substack and create two cards (one for portrait and one for landscape).
Then use the orientationChanged message to switch between cards.
I use it and it works quite well.
-
- Livecode Opensource Backer
- Posts: 211
- Joined: Sun Oct 24, 2010 12:13 am
Re: Coding for both orientations
That's a great idea. Could you maybe use this idea to have different screens for different hardware? On startup of the stack, you could check to see what the environment was, then switch to the appropriate card.
-
- Posts: 111
- Joined: Sun Aug 23, 2009 7:48 am
- Contact:
Re: Coding for both orientations
Yes you can! I've tried this and it works great. I made a sub-stack for iPhone, one for iPhone Retina, one for iPad, but haven't yet made different cards for different orientations, but I would definitely go for a two card approach.richardmac wrote:That's a great idea. Could you maybe use this idea to have different screens for different hardware? On startup of the stack, you could check to see what the environment was, then switch to the appropriate card.
___________________________________
MacBook Pro M1 MAX 64 Gb,
LiveCode 10.0.1rc3
MacBook Pro M1 MAX 64 Gb,
LiveCode 10.0.1rc3
Re: Coding for both orientations
Just to add, if you do set up two cards, make sure the orientationChanged message is at the card level, and not stack level.
Ive just spent 'a while' with my layout whirling round as the stack was getting so many orientationChanged messages, but when I moved them onto the appropriate cards all is now ok!
Ive just spent 'a while' with my layout whirling round as the stack was getting so many orientationChanged messages, but when I moved them onto the appropriate cards all is now ok!