Android Question Views disappearing from Panel [Solved}

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi All,

I have a feeling I have encountered this before but can't find anything searching the forum.

I have a panel with 3 buttons, when I try to set the vertical position of the buttons they disappear. I have no problem setting the horizontal positions.

Labels behave the same way.

I have tried this in the designer script and in code, same result.

The following is from the script, no surprises

B4X:
'BtnMetric.Bottom = PnlUnits.Bottom
'BtnImp.VerticalCenter = PnlUnits.VerticalCenter
'BtnUS.VerticalCenter = PnlUnits.VerticalCenter
BtnMetric.HorizontalCenter = PnlUnits.HorizontalCenter
BtnImp.Right = BtnMetric.Left - 20dip
BtnUS.Left = BtnMetric.Right + 20dip

Any help appreciated.
Regards Roger
 

LucaMs

Expert
Licensed User
Longtime User
Hi All,

I have a feeling I have encountered this before but can't find anything searching the forum.

I have a panel with 3 buttons, when I try to set the vertical position of the buttons they disappear. I have no problem setting the horizontal positions.

Labels behave the same way.

I have tried this in the designer script and in code, same result.

The following is from the script, no surprises

B4X:
'BtnMetric.Bottom = PnlUnits.Bottom
'BtnImp.VerticalCenter = PnlUnits.VerticalCenter
'BtnUS.VerticalCenter = PnlUnits.VerticalCenter
BtnMetric.HorizontalCenter = PnlUnits.HorizontalCenter
BtnImp.Right = BtnMetric.Left - 20dip
BtnUS.Left = BtnMetric.Right + 20dip

Any help appreciated.
Regards Roger

I think you mean the 3 lines commented does not work and the parent of the 3 buttons is PnlUnits.

BtnMetric: if you want to move it to the bottom of PnlUnits, you should set:
BtnMetric.Bottom = PnlUnits.Height
(you can get the same setting BtnMetric Vertical Anchor to Bottom and Bottom Edge Distance = 0)

BtnImp and BtnUS: if you want to center them in PnlUnits:
BtnImp.VerticalCenter = PnlUnits.Height / 2
BtnUS.VerticalCenter = PnlUnits.Height / 2 (or BtnUS.Top = BtnImp.Top, HERE)
 
Upvote 0
Top