Firemonkey TVertScrollBox alternative to VCL ScrollBox ScrollInView

  

I am using Delphi XE8 to develop an Android application, and I want to move the ViewportPosition of a VertScrollBox when a button is clicked, to see a specific component (somewhere in the VertScrollBox).

But set the value of ViewportPosition does not work (I tried the answer here : Go Top a TVertScrollBox) and the method ScrollBy does not work neither (http://docwiki.embarcadero.com/Libraries/Seattle/en/FMX.Layouts.TVertScrollBox).

I tried this :

procedure TFormTournee.T3ButtonBackToTopClick(Sender: TObject);
begin
T1VertScrollBox.ViewportPosition := PointF(T1VertScrollBox.ViewportPosition.X, 0);
T1VertScrollBox.RealignContent;
end;

And that :

procedure TFormTournee.T3ButtonBackToTopClick(Sender: TObject);
begin
T1VertScrollBox.ScrollBy(0,-100);
T1VertScrollBox.RealignContent;
end;

For now, I just tried on Windows (I have to fix an other problem on Android about insufficient storage), but nothing change when I click, and it is supposed to work the same on Windows and Android, isn’t that right ? So can anybody help me, please ? Or perhaps explain me what I am doing wrong ? Thanks !

Comments are closed.