Page 1 of 2
Screen Not Resizing Properly on iPad
Posted: Fri Jan 16, 2015 11:10 pm
by Gage
Hello friends!
I'm nearing the completion of an app to be deployed to both Android and iOS right now.
I have just gotten my hands on some iOS devices to do testing, and I'm finding that on the larger iPad screen, my stack does not properly resize.
I have used a number of different approaches, but all of them have had the same problem so far.
My attempts:
- Set fullScreenMode of stack to "exactFit"
- Set fullScreenMode of stack to "showAll"
- used the ResizeControls handler copied from the helpful stack provided by the author of this forum thread:
http://forums.livecode.com/viewtopic.ph ... na#p112679
- Hugely scaling up the dimensions of my stack in the IDE, in hopes that the processor wouldn't reach some sort of resolution limit when resizing my app to fit the iPad screen
Despite all of these attempts, the LiveCode stack simply doesn't fill the iPad screen. It is center on the device's screen, but there is a sizable eyesore of a black border around the stack. Obviously, since it is the stack that doesn't take up the space, enlarging my objects doesn't solve the issue, either.
Does anyone know how to coax an iPad (with a Retina Screen, if that matters) into allowing my LiveCode stack the full non-system real estate?
Screenshot image of the issue has been included.
Thanks in advance!
Phil E.
Re: Screen Not Resizing Properly on iPad
Posted: Sat Jan 17, 2015 12:36 am
by Klaus
Hi Phil,
what is the actual size (W & H) of your stack?
I always use 768*1024, which will fit and look nicely on any retina iPad.
OK, I don't do Android (yet)
Best
Klaus
Re: Screen Not Resizing Properly on iPad
Posted: Sat Jan 17, 2015 12:46 am
by keithglong
Howdy,
I have found that using a stack size of 373 x 668 and setting the "fullscreenmode" of the stack to "ShowAll" (in lieu of "LetterBox") results in a decent display on various devices (including iphone, iPad, Kindle Fire HDX, etc.).
Cheers,
- Boo
Re: Screen Not Resizing Properly on iPad
Posted: Sat Jan 17, 2015 1:20 am
by Gage
Hi Klaus,
Originally, we were developing on a stack that was 330 W x 575 H in the IDE.
However, using the dimensions of 800 W x 1500 H also yielded the same weird black border around our stack on the iPad.
I just gave your numbers a try, and had the same results as before, just with slightly differently scaled objects. Unfortunately, the unsightly black border around the stack is still there.
I wouldn't call it a border, so much as it seems to be unused screen real estate that my stack seems not to have access to.
Still puzzling... thanks for the feedback!
Phil E.
Re: Screen Not Resizing Properly on iPad
Posted: Sat Jan 17, 2015 1:56 am
by keithglong
Hi Again,
Although I am new to mobile development, I had a problem awhile back with a stack not maintaining the set dimensions (i.e., as set in the property inspector) upon opening of the stack. In the "preOpenStack" handler, I had to put "set the height of this stack to 668" in order for it to size correctly before setting it into "fullscreenmode," or something to that effect. You might want to try setting your stack size manually in the "preOpenStack" handler (per the above) and seeing if that helps you access some of that real estate... (Although you might have already tried this.)
Cheers,
- Boo
Re: Screen Not Resizing Properly on iPad
Posted: Sat Jan 17, 2015 1:59 am
by Gage
Thanks for the insight, Boo.
I'll give it a shot before setting the fullScreenMode.
Cheers,
Phil E.
Re: Screen Not Resizing Properly on iPad
Posted: Sat Jan 17, 2015 9:34 pm
by jacque
The black borders are drawn in certain full screen modes when the width/height ratio of the card doesn't match the ratio of the screen. Some of the modes avoid this, and others like letterbox and noScale fill in empty areas with black. You could try noBorder and see how that works. It will scale the stack to fill the screen, but anything outside the card rect will be cut off.
Re: Screen Not Resizing Properly on iPad
Posted: Sun Jan 18, 2015 1:16 am
by Gage
Upon further exploration, I'm realizing that it's probably a feature of Test Flight, which I am using to test my project, but the screen has a zoom feature in the top corner.
The actual size of my stack is only filling the center of the screen, but what's more, LiveCode is not even interpreting the rest of the screen to be available.
I tested this by answering the ScreenRect and the width and stack of my stack when the interface loads.
I have included some pictures, now including the 1x zoom level (it was 2x before by default, thanks to Test Flight, I'm pretty sure).
This may give responders more insight about the problem I am having. In the meantime, I will be writing a bug report for LiveCode, since I am nearly certain that it is not proper behavior for the ScreenRect function to return numbers that are incorrect. In my case, I am using an Apple iPad 4 with Retina Screen, so the resolution is supposed to be 2048 x 1536, but the ScreenRect is returning 0,0,640,960.
Still looking for input about a fix, but it looks like the engine is not reading the space outside the stack as being available, even though there is plenty to be used.
Images attached.
Wishing everyone an enjoyable weekend!
Phil E.
Re: Screen Not Resizing Properly on iPad
Posted: Sun Jan 18, 2015 8:26 pm
by jacque
Take a look at the iphoneUseDeviceResolution in the dictionary. The engine will return the screenRect (and other coordinates) in points rather than pixels, which allows scripts to calculate positioning identically on any device regardless of the actual pixel resolution. If you want to work with exact pixels instead of points, set the iphoneUseDeviceResolution to true.
Re: Screen Not Resizing Properly on iPad
Posted: Sun Jan 18, 2015 8:45 pm
by Gage
Jacque,
I have already set that property to "true,true" actually. Still no good.
Thanks,
Phil E.
Re: Screen Not Resizing Properly on iPad
Posted: Sun Jan 18, 2015 10:32 pm
by keithglong
Hi Phil,
It might be helpful if you could post a sample stack for folks on the forum to experiment with. A stack with your basic controls in place, and with "orientationChanged," "resizeStack", and other necessary handlers in place to duplicate the issue would be helpful. (Of course, you could first remove all of your valuable and proprietary code.)
It would be interesting to take a look, firsthand, at what is going on. I for one would be willing to play around with it. (And it would be nice to nip this one in the bud. I have a similar display issue that I've been struggling with...)
Cheers from Florida,
- Boo
Re: Screen Not Resizing Properly on iPad
Posted: Sun Jan 18, 2015 10:52 pm
by Gage
Thanks for prompting me, Boo.
Here you go - very simple. I actually submitted this as a Bug Report to LiveCode already with this stack. It may be device specific; I stripped all of the script out and was able to reproduce it.
Thanks for the support, and I hope it lends to helping you resolve your issue, as well!
Phil E.
San Jose, CA
Re: Screen Not Resizing Properly on iPad
Posted: Sun Jan 18, 2015 11:58 pm
by keithglong
Hi Phil,
I just took a look at your stack. I suspect that the problem is that in your Standalone IOS settings, you have it set to "iPod and iPhone." Try setting it to "iPod, iPhone and iPad." Also, when testing, I set the fullscreenmode to "showall" to keep the proportions of your graphics.
Please let me know if this fixes your problem.
Sincerely,
- Boo
Re: Screen Not Resizing Properly on iPad
Posted: Mon Jan 19, 2015 12:04 am
by Gage
Boo,
Well, how humbling. I have to wait a while before I will be able to test that, as my iPad is currently traveling.
I'm used to developing for Android, where no such distinctions exist as options, so I guess I was bound to learn that at some point.
Thanks for your attention, I'm hoping that's it!
Kind regards,
Phil E.
Re: Screen Not Resizing Properly on iPad
Posted: Mon Jan 19, 2015 12:37 am
by keithglong
Hi Phil,
My pleasure; I think all should work well now.
Cheers,
- Boo