hi @xorpas well, if you ok for you, then, it's ok!
try my new sample:
uMyFrameWithRectangle with your Frame and your rectangles or any others
the "Rectangle2" is just of show "green color", not needs it!!!
type
TMyFrameRectangle = class(TFrame)
MyRectangleToMove: TRectangle;
FloatAnimation1: TFloatAnimation;
Rectangle2: TRectangle;
private
{ Private declarations }
public
constructor Create(AOwner: TComponent); override;
end;
implementation
{$R *.fmx}
constructor TMyFrameRectangle.Create(AOwner: TComponent);
begin
inherited;
//
FloatAnimation1.Enabled := false;
FloatAnimation1.AutoReverse := false;
FloatAnimation1.PropertyName := 'Height';
FloatAnimation1.Duration := 0.5;
FloatAnimation1.Trigger := 'IsMouseOver=true';
FloatAnimation1.TriggerInverse := 'IsMouseOver=false';
//
FloatAnimation1.StartValue := MyRectangleToMove.Height;
FloatAnimation1.StopValue := FloatAnimation1.StartValue + (FloatAnimation1.StartValue * 1.4); // +140%
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
uses
uMyFrameWithRectangle;
procedure TForm1.Button1Click(Sender: TObject);
var
MyFrameRectangle: TMyFrameRectangle;
begin
for var i: integer := 1 to 5 do
begin
MyFrameRectangle := TMyFrameRectangle.Create(nil);
//
VertScrollBox1.AddObject(MyFrameRectangle);
end;
end;
initialization
ReportMemoryLeaksOnShutdown := true;
end.