1
votes

I use these code below, but it did not show the line when I run the program on IOS sim. I dont see any demo from embarcadero, does anybody know how to do it?

I'm using Embarcadero Delphi XE4 for iOS.

procedure TForm1.ListBoxItem3Paint(Sender: TObject; Canvas: TCanvas;
  const ARect: TRectF);
begin
  Canvas.BeginScene;
  Canvas.DrawLine(ARect.TopLeft, ARect.BottomRight, 1);
  Canvas.EndScene;
end;
1

1 Answers

0
votes

it seems you have to set the Stroke before painting:

procedure TForm1.ListBoxItem3Paint(Sender: TObject; Canvas: TCanvas;
    const ARect: TRectF);
begin
  Canvas.Stroke.Thickness:=1;
  Canvas.Stroke.Kind:=TBrushKind.bkSolid;
  Canvas.Stroke.Color:=$FF000000;
  Canvas.DrawLine(ARect.TopLeft, ARect.BottomRight, 1);
end;