Problem with Designer Scripts

ciginfo

Well-Known Member
Licensed User
Longtime User
Hi,
Why my views are misplaced when I send my project to IU Cloud.
B4X:
'All variants script
'AutoScaleAll 'uncomment to scale all views based on the device physical size.

Panel_Splash.Top = 0%y
Panel_Splash.left = 0%x
Panel_Splash.Width = 100%x
Panel_Splash.Height = 100%y

ImgPub1.Left = 0%x
ImgPub1.width = 100%x
ImgPub1.Height = 10%y
ImgPub1.Bottom = 100%y

BtnSMS.Left = 5%x
BtnSMS.Width = 90%x
BtnSMS.Height = 10%y
BtnSMS.Bottom = 80%y 

MapWebView.Top =0%x
MapWebView.Left =0%X
MapWebView.Width = 100%x
MapWebView.Height = 100%y

BtnMail.Left = 5%x
BtnMail.Width = 90%x
BtnMail.Height = 10%y
BtnMail.Bottom = 90%y 

PnlPosition.Width = 100%x
PnlPosition.Right = 100%x
PnlPosition.Top = 0%y
'LblPosition.HorizontalCenter = 50%x
LblPosition.SetLeftAndRight(15dip, PnlPosition.Width - 15dip)
'LblAdresse.HorizontalCenter = 50%x
LblAdresse.SetLeftAndRight(15dip, PnlPosition.Width - 15dip)

LblAide.Right = 90%x
LblAide.Width = 80%x
LblAide.Top = ImageView1.Bottom + 3dip

BtnMap.Right = 100%x - 35dip
BtnMap.Top = PnlPosition.Bottom
BtnMap.Width = ImageView1.Width
BtnMap.Height = ImageView1.Height


ImageView1.Left = 35dip
ImageView1.Top = PnlPosition.Bottom

On my device Gakaxy S2 it is OK but on UI Cloud, with the Galaxy Note and the Samsung 1900, some views or buttons are poorly positioned despite a script that I think correct.
For example, "ImgPub1" does not reach the bottom of the screen or does not occupy the entire width of the screen as I show on the attachements.
Thank you.
NB : When I send to UI Cloud it says : " Layout is long than 500 kb, it will be send without files.
 

Attachments

  • Galaxy_Note.jpg
    20.5 KB · Views: 295
  • Samsung_1900.jpg
    20.9 KB · Views: 361

mistermentality

Active Member
Licensed User
Longtime User
If you intend buttons such as your SMS button to be centred as it is in first pic then your code does not allow this because it says the button should always be 5%x from left.

So even at high resolutions it will always be kept close to the left, not centred. You could find out the width of half the button and set its left position to 50%x - half button width %, that would make it centre better.

Dave

Sent from my Nexus 7
 
Upvote 0

CidTek

Active Member
Licensed User
Longtime User

Since he sets the width at 90% why wouln't his method work?

With 10% of available space remaining then setting left at 5% should work.
 
Upvote 0

mistermentality

Active Member
Licensed User
Longtime User
Since he sets the width at 90% why wouln't his method work?

With 10% of available space remaining then setting left at 5% should work.

I agree that it looks like it should but if it was working the width in the two screenshots should both take up same amount of screen and yet they don't.

While I'm unsure why the width isn't being set at different resolutions (perhaps because of use of both dip and % in the code?) the surest solution is to change the left position to compensate until that problem is corrected.

Dave

Sent from my Nexus 7
 
Upvote 0

CidTek

Active Member
Licensed User
Longtime User

Does the fact autoscaleAll is not uncommented have anything to do with it?
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
In fact UI Cloud works poorly. Here joined another very simple layout and if you try it you will see that ImageView and buttons are instead specified in the script.
Why?
 

Attachments

  • essai.bal
    2.3 KB · Views: 204
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…