Skip to content

FMXUI Translucent System Bar

KngStr edited this page Jul 2, 2019 · 2 revisions

Operation

Add fllowing code to OnCreate event of main form.

procedure TForm1.FormCreate(Sender: TObject);
begin
  TFrameView.SetDefaultStatusColor($ff800080);
  TFrameView.SetDefaultBackColor($fff1f2f3);
end;

Attention

  • If only SetDefaultStatusColor is called, the default back color will be 0xfff1f2f3.
  • Use LocalToAbsolute to calculate absolute postion. Sometimes you should plus - TView.GetStatusHeight.

Android

  • Require API > 21 (Android 5.0).
  • Add res\android\styles_translucent.xml to Deployment, and set Remote Path to res\values-v19\.
    deploy

iOS

Actually in iOS status color is Fill of current form. But you still have to call these code.

Fill

If something is wrong, check the fill property of form. Make sure kind of it is solid.

Clone this wiki locally