Android Question Problem Designer Script

maurizio barbera

Member
Licensed User
Longtime User
Hi, I created a script to adapt the view of the screen. in all ok visual designer, but when I start debugging on the display you see the view out of the screen ... for instance. (I know that the designer does not enter the lower part but my problem is the right side)

the code is:

lblIP.Top = 5dip
lblIP.Left = 5dip
lblPort.Top = lblIP.Top + lblIP.Height + 5dip
lblPort.Left = lblIP.Left
lblUtente.Top = lblPort.Top + lblPort.Height + 5dip
lblUtente.Left = lblIP.Left
lblPassword.Top = lblUtente.Top + lblUtente.Height + 5dip
lblPassword.Left = lblIP.Left
lblDBdaUsare.Top = lblPassword.Top + lblPassword.Height + 5dip
lblDBdaUsare.Left = lblIP.Left
lblDatabase.Top = lblDBdaUsare.Top + lblDBdaUsare.Height + 5dip
lblDatabase.Left = lblIP.Left
cmdSalva.Top = lblDatabase.Top + lblDatabase.Height + 5dip + 5dip
cmdSalva.Left = lblIP.Left
cmdTestIP.Top = 5dip
cmdTestIP.Left = 100%x - cmdTestIP.Width - 5dip
cmdTestIP.Height = txtPassword.Top + txtPassword.Height + 5dip
cmdLeggiDB.Top = lblDatabase.Top
cmdLeggiDB.Left = cmdTestIP.Left
cmdLeggiDB.Height = lstDatabase.Height
cmdEsci.Top = cmdSalva.Top
cmdEsci.Left = 100%x - cmdEsci.Width - 5dip
txtIP.Top = lblIP.Top
txtIP.Left = lblIP.Left + lblIP.Width + 5dip
txtIP.Width = cmdTestIP.Left - lblIP.Left - lblIP.Width - 10dip
txtPort.Top = lblPort.Top
txtPort.Left = txtIP.Left
txtPort.Width = txtIP.Width
txtUtente.Top = lblUtente.Top
txtUtente.Left = txtIP.Left
txtUtente.Width = txtIP.Width
txtPassword.Top = lblPassword.Top
txtPassword.Left = txtIP.Left
txtPassword.Width = txtIP.Width
lblNomeDatabase.Top = lblDBdaUsare.Top
lblNomeDatabase.Left = txtIP.Left
lblNomeDatabase.Width = txtIP.Width
lstDatabase.Top = lblDatabase.Top
lstDatabase.Left = txtIP.Left
lstDatabase.Width = txtIP.Width
 

Attachments

  • imageDesigner.png
    imageDesigner.png
    24.1 KB · Views: 147
  • imageDevice.jpg
    imageDevice.jpg
    213.4 KB · Views: 151

maurizio barbera

Member
Licensed User
Longtime User
I posted a project, the designer if you run the scipt see that everything is ok ... but no device
 

Attachments

  • TestDesigner.zip
    9.1 KB · Views: 107
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can easily replace all the script code with anchors.

Note that there are two calls to AutoScaleAll in your script. You should remove the call from the variant script.

This is how your layout should look like (notice the small anchor indicators):
SS-2016-02-21_09.27.28.png


Remove all the script except of a single AutoScaleAll in the general script.
 
Last edited:
Upvote 0

maurizio barbera

Member
Licensed User
Longtime User
I check on the still and are just ... they are the same projects ... font change only in name...
AutoScalleAll verify fonts/size font???
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Non sto dicendo che la colpa sia del font, ma siccome vedo due font differenti ho pensato che abbia usato due progetti differenti per generare le immagini.

E comunque ho scritto una cavolata, perché non soltanto quelle due view debordano.

Provo a scaricare il tuo progetto e modificarlo come ha detto Erel... vediamo.

-----

Sorry...

I'm seeing that other views overflow.
I try to download your project.
 
Upvote 0

maurizio barbera

Member
Licensed User
Longtime User
Thanks Luca ... I resolve to modify the layer on Activity_Create setting all controls ... but I would avoid it ... and do it automatically ... if you have many layers it takes a long time to resize them ...
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
It is very simple. Please read my answer again:

Note that there are two calls to AutoScaleAll in your script. You should remove the call from the variant script.

But not in mine (#13)

Also, I think there is a bug in the Designer (B4A 5.50):
Please, compare the project attached in #16 with the one attached here (B4A 4.30)
 

Attachments

  • TestDesigner B4A 430.zip
    12.6 KB · Views: 115
Upvote 0
Top