School lesson 2 test app screen size issue

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

School lesson 2 test app screen size issue

Post by roddy » Tue Mar 25, 2014 2:43 am

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

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: School lesson 2 test app screen size issue

Post by LCNeil » Tue Mar 25, 2014 11:42 am

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
——

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: School lesson 2 test app screen size issue

Post by roddy » Tue Mar 25, 2014 4:24 pm

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.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: School lesson 2 test app screen size issue

Post by LCNeil » Tue Mar 25, 2014 4:38 pm

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
——

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: School lesson 2 test app screen size issue

Post by roddy » Tue Mar 25, 2014 4:45 pm

The dictionary says the pixelscale property is only supported on iOS and Andriod.

This worked:

on preopenStack
iphoneUseDeviceResolution true
end preopenStack

Cheers!

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: School lesson 2 test app screen size issue

Post by roddy » Tue Mar 25, 2014 4:47 pm

That worked too, thanks.

Post Reply

Return to “idea2app and Coding School”