Variant Specific Script not woking

LisaM

Member
Licensed User
Longtime User
Hi
Just have a query I have created variant specific script for portrait and for landscape when the phone/emulator is connected to the designer it displays correctly for both portrait and landscape layouts but once I debug or release the application the landscape variant does not work when the phone/emulator is rotated the activity still uses the portrait specific script.

Here is the code from both orientations

B4X:
'Variant specific script: 480x800,scale=1
Panel2.Width = 100%x
Panel2.Height = 100%y

btnWorkout.HorizontalCenter = 50%x
btnFitTest.HorizontalCenter = 50%x
btnProfile.HorizontalCenter = 50%x
btnCalendar.HorizontalCenter = 50%x
btnSettings.HorizontalCenter = 50%x
btnProfile.VerticalCenter = 70%y
btnFitTest.Bottom = btnProfile.Top
btnWorkout.Bottom = btnFitTest.Top
btnCalendar.Top = btnProfile.Bottom
btnSettings.top = btnCalendar.Bottom

ImageView1.HorizontalCenter = 50%x
ImageView1.Top = 10dip
Label2.HorizontalCenter = 50%x
Panel1.HorizontalCenter = 50%x
Panel1.VerticalCenter = 35%y
Label2.Bottom = 100%y - 2dip

ScrollTips.Width = 100%x
ScrollTips.Height = 100%y
ScrollTips.HorizontalCenter = 50%x
ScrollTips.VerticalCenter = 50%y
Label1.HorizontalCenter = 50%x
Label18.Bottom = 100%y - 5dip
btnhelp.Bottom = 100%y - 5dip

B4X:
'Variant specific script: 800x480,scale=1
ImageView1.HorizontalCenter = 30%x
ImageView1.VerticalCenter = 25%y

btnWorkout.HorizontalCenter = 77%x
btnFitTest.HorizontalCenter = 77%x
btnProfile.HorizontalCenter = 77%x
btnProfile.VerticalCenter = 50%y
btnCalendar.HorizontalCenter = 77%x
btnSettings.HorizontalCenter = 77%x
btnFitTest.Bottom = btnProfile.Top
btnWorkout.Bottom = btnFitTest.Top
btnCalendar.Top = btnProfile.Bottom
btnSettings.Top = btnCalendar.Bottom

Label2.HorizontalCenter = 50%x
Label3.HorizontalCenter = Panel1.Width / 2
Label4.HorizontalCenter = Panel1.Width / 2
Label4.VerticalCenter = Panel1.Height / 2
Panel1.HorizontalCenter = 28%x
Panel1.VerticalCenter = 70%y

ScrollTips.Width = 100%x
ScrollTips.Height = 100%y
ScrollTips.HorizontalCenter = 50%x
ScrollTips.VerticalCenter = 50%y
Panel3.Width = 100%x
Panel3.Height = 100%y
Panel3.HorizontalCenter = 50%x
Panel3.VerticalCenter = 50%y

Label1.HorizontalCenter = 50%x
Label2.Bottom = 100%y - 5dip
Label18.Bottom = 100%y - 5dip
btnhelp.Bottom = 100%y - 5dip

What have i done wrong??
Thnx
 

LisaM

Member
Licensed User
Longtime User
I am using version 2.22
Do you think i should update to 2.3? I have put off doing so as i am close to finishing my app and 2.3 is in Beta and did not want to risk anything going wrong.
 
Upvote 0

LisaM

Member
Licensed User
Longtime User
I tested it out I checked out the code in the designer script to see what was suppose to happen, unfortunately again the same problem exists in the designer the script works but when i debug the only script that works is the 480 x 800, scale=1(160dpi)

Thnx for test though :)
 
Upvote 0

LisaM

Member
Licensed User
Longtime User
Ok i got it working
I went back to the small 320 x 480, scale=1 (160dpi) and 480 x 320
and what do you know it works!! I dont know why i changed it the first place it was so long ago, anyway for some reason testing your test app sparked the thought so thank you very much for that!!
:sign0188:
 
Upvote 0

LisaM

Member
Licensed User
Longtime User
Sure I'll load my main file I'm in the middle of adding a Tablet version layout aswell. I left the 480 x 800 variants in there so you can have a look at what i have done :)
 

Attachments

  • laymain.bal
    21.3 KB · Views: 221
Upvote 0

LisaM

Member
Licensed User
Longtime User
Hmm mystery i guess ;)
Thnx for your time and effort, You did help me I'm back on track now and the layouts are working well. I can finally finish my project.

Thnx again!!
 
Upvote 0
Top