FMXNavBar not displaying captions

Simple question,


Using TMSFMXNavBar and attempting to create items programmatically as such:

var
  aPanel:TTMSFMXNavBarPanel;

...

    aPanel:=TTMSFMXNavBarPanel.Create(TMSFMXNavBar1);
    aPanel.Caption:='Item';
    TMSFMXNavBar1.AddPanel(aPanel);

At runtime there is no caption displayed on header or selection buttons. 

Adding panels at design time renders these captions correctly.

Is there something I am missing? the documentation on this component is limited and suggests the above will work.

Thanks


I tested this here with code:


var
  cp: TTMSFMXNavBarPanel;
begin
  TMSFMXNavBar1.BeginUpdate;
  cp := TMSFMXNavBar1.CreatePanel;
  cp.Caption := 'New panel';
  TMSFMXNavBar1.AddPanel(cp);
  TMSFMXNavBar1.EndUpdate;
end;

and this adds a panel with its caption.

Ok,


tried that and still not getting the caption visible on the control. I am switching this in and out of being visible but that shouldn't be problematic. I have change no other properties other than dropping this on a TMultiView.

Tried adding a panel at design time and then adding new panels at runtime and the design time panel shows the caption, whereas the runtime still not displaying

FYI removing this onto a normal panel and not the FMX multiview component remedies the problem!

There must be an interference from the multiview then. Are you executing the code to add a panel in the form create or form show or later time, from a button for example?

Good thought! By placing code in onshow method the problem is resolved.


Regards