Android Question Designer issues

marcel

Active Member
Licensed User
Longtime User
I have the following designer code:
B4X:
'All variants script
AutoScaleAll

Panel1.SetLeftAndRight(0,100%x)
Panel1.SetTopAndBottom(80dip,90%y)

pnlFeedback.SetLeftAndRight(10%x,90%x)
pnlFeedback.Bottom=Panel1.Bottom
pnlFeedback.Height=80dip

btnUP.Top=2dip
btnUP.Left=2dip
btnUP.Height=pnlFeedback.Height-4dip
btnUP.Width=btnUP.Height

btnDown.Top=2dip
btnDown.Right=pnlFeedback.Right-5dip
btnDown.Height=pnlFeedback.Height-4dip
btnDown.Width=btnDown.Height

What do I wrong, See attachments for design pictures. The feedback panel is not on the bottom. The button right is not to the right panel side minus 5 dip.
 

Attachments

  • 2016-01-15 21_46_31.png
    2016-01-15 21_46_31.png
    10 KB · Views: 186
  • 2016-01-15 21_47_19.png
    2016-01-15 21_47_19.png
    2.6 KB · Views: 197

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
have you tried to assign them the width and height before their positions ?
 
Upvote 0

marcel

Active Member
Licensed User
Longtime User
Yes, Also. Seems some difference but still not the correct result.
 

Attachments

  • test.zip
    8.8 KB · Views: 189
Upvote 0

klaus

Expert
Licensed User
Longtime User
This is wrong: btnDown.Right=pnlFeedback.Right-5dip
You must replace it by:
btnDown.Right=pnlFeedback.Width-2dip
pnlFeedback.Right is the Right coordinate of pnlFeedback in Panel1 !
You must position btnDown according to the width of pnlFeedback.
 
Upvote 0

marcel

Active Member
Licensed User
Longtime User
Thanks. And why is this not working:

pnlFeedback.Bottom=Panel1.Bottom

Basically the bottom of the feedback pannel should be equal to the bottom of the panel1.

but pnlFeedback.Bottom=100%y
is.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Basically the bottom of the feedback pannel should be equal to the bottom of the panel1.
No, it's the same as with Right and Width.

You should replace this code;
B4X:
pnlFeedback.SetLeftAndRight(10%x,90%x)
pnlFeedback.Bottom=Panel1.Bottom
pnlFeedback.Height=80dip
by this one:
B4X:
pnlFeedback.SetLeftAndRight(10%x,90%x)
pnlFeedback.Height=80dip
pnlFeedback.Bottom=Panel1.Height
You must set the pnlFeedback.Height property before the Bottom property.
And set the the pnlFeedback.Bottom property to the Panel1.Height property.
 
Upvote 0
Top