Temporary lines in objects created at runtime

  

When I create objects at runtime in FireMonkey, some lines are shown on the sides of the objects.
The image below is a TLayout. When I resize the Form or move the mouse, the lines disappear. This happens with TImage, TRectangle, TLayout, and other components.
Can someone give me a solution for this graphic problem?
TLayout showing the lines:

TLayout after resizing the Form:

var
backRectangle: TRectangle;
category, title: TLabel;
icon: TImage;
bar: TRectangle;
background: TGridPanelLayout;
lay1, layicon: TLayout;
begin
backRectangle := TRectangle.Create(Self);
with backRectangle do
begin
Height := 150;
Align := TAlignLayout.top;
Fill.Color := Talphacolors.White;
Parent := Self;
Stroke.Thickness := 0;
Margins.Left := 20;
Margins.Top := 20;
Name := ‘rectangle’;
end;

background := TGridPanelLayout.Create(backRectangle);
with background do
begin
Parent := backRectangle;
Align := TAlignLayout.Client;
ColumnCollection.ClearAndResetID;
ColumnCollection.BeginUpdate;

with ColumnCollection.Add do
begin
Value := 100;
SizeStyle := TGridPanelLayout.TSizeStyle.Percent;
end;

ColumnCollection.EndUpdate;
RowCollection.Clear;
end;

lay1 := TLayout.Create(backRectangle);
lay1.Parent := backRectangle;
lay1.Align := TAlignLayout.client;
background.AddObject(lay1);

layicon := TLayout.Create(lay1);
layicon.Parent := lay1;
layicon.Align := TAlignLayout.client;

category := TLabel.Create(backRectangle);
with category do
begin
StyledSettings := [];
AutoSize := true;
Parent := lay1;
Align := TAlignLayout.None;
BeginUpdate;
TextSettings.BeginUpdate;
TextSettings.Font.Family := ‘Roboto’;
TextSettings.Font.Style := [TFontStyle.fsBold];
TextSettings.Font.Size := 16;
Text := ‘category’;
TextSettings.EndUpdate;
Margins.Left := 25;
Margins.Right := 0;
Margins.Bottom := 6;
Margins.Top:= 10;
TabOrder := 0;
end;

bar := TRectangle.Create(backRectangle);
bar.Width := 100;
bar.Height := 3;
bar.Fill.Color := $FF518CD2;
bar.Parent := lay1;
bar.Align := TAlignLayout.None;
bar.Stroke.Thickness := 0;
bar.Margins.Right := 20;

icon := timage.Create(layicon);
with icon do
begin
Parent := lay1;
Width := 30;
Margins.Left := 20;
Margins.Right := 20;
Margins.Bottom := 15;
Margins.Top := 45;
WrapMode := TImageWrapMode.fit;
Align := TAlignLayout.FitLeft;
try
Bitmap.LoadFromFile(‘icon’);
except
end;
end;

title := TLabel.Create(layicon);
with title do
begin
StyledSettings := [];
Parent := lay1;
Text := ”;
Align := TAlignLayout.Client;
TextSettings.Font.Family := ‘Roboto’;
TextSettings.Font.Style := [];
TextSettings.Font.Size := 16;
Margins.Left := 10;
TextSettings.VertAlign := TTextAlign.Center;
end;
bar.Align := TAlignLayout.Top;
category.Align := TAlignLayout.Top;
end;

Comments are closed.