Page 1 of 1

School lesson 2 test app screen size issue

Posted: Tue Mar 25, 2014 2:43 am
by roddy
I've set-up the lesson 2 test app for my iPhone 4s 640x960 but when I load it onto my 4s it isn't the correct size. I can only see part of the title bar that says contacts. I'm using LC 6.6 and Xcode 5.1. Phone is iOS 7.1. Is this a bug or do I have something set-up incorrectly?

Roddy

Re: School lesson 2 test app screen size issue

Posted: Tue Mar 25, 2014 11:42 am
by LCNeil
Hi Roddy,

As of LiveCode 6.5.1, there was a new property added that determines the scaling factor between logical and device pixels and this will explain why some of your stack is cut off. The pixelScale is initialised to the systemPixelScale on startup but can be modified whenever needed.

If you add the following to your stack script then your app will display correctly on iOS-

Code: Select all

on openStack

set the pixelScale to 1

end openStack
Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

Re: School lesson 2 test app screen size issue

Posted: Tue Mar 25, 2014 4:24 pm
by roddy
Hi Neil,

That's giving me the error:

pixelScale: the pixelScale property cannot be set on this platform

I'm developing on Mavericks with LC 6.6 and targeting iOS 7.1 on the simulator.

Re: School lesson 2 test app screen size issue

Posted: Tue Mar 25, 2014 4:38 pm
by LCNeil
Hi Roddy,

Pixel scale is a mobile specific property so you will receive an error when you attempt to execute it within the desktop environment. You will need to add some additional checks so that the property is only set on mobile-

Code: Select all

on openStack
   if the environment is "mobile" then
      set the pixelScale to 1
   end if
end openStack
Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

Re: School lesson 2 test app screen size issue

Posted: Tue Mar 25, 2014 4:45 pm
by roddy
The dictionary says the pixelscale property is only supported on iOS and Andriod.

This worked:

on preopenStack
iphoneUseDeviceResolution true
end preopenStack

Cheers!

Re: School lesson 2 test app screen size issue

Posted: Tue Mar 25, 2014 4:47 pm
by roddy
That worked too, thanks.