.
. , , .
OnClick , :
var
r: TRectangle;
begin
// Find the background TRectangle style element for the button
r := (Button1.FindStyleResource('background') as TRectangle);
if Assigned(r) then
begin
r.Fill.Color := claBlue;
end;
end;
: FMX.Objects , . TRectangle.
...
, . - . stylename TColorAnimation , . colorolimation1 coloranimation2 TColorAnimations.
:
var
r: TRectangle;
ca: TColorAnimation;
begin
// Find the background TRectangle style element for the button
r := (Button1.FindStyleResource('background') as TRectangle);
if Assigned(r) then
begin
r.Fill.Color := claBlue;
end;
ca := (Button1.FindStyleResource('coloranimation1') as TColorAnimation);
if Assigned(ca) then
begin
ca.StartValue := claBlue;
end;
ca := (Button1.FindStyleResource('coloranimation2') as TColorAnimation);
if Assigned(ca) then
begin
ca.StopValue := claBlue;
end;
: FMX.Ani TColorAnimation.