Why do firemonkey controls always claim to have a child control on iOS?

  

I’m working on dynamically creating controls (TImageControl) inside of a panel (and as part of trial/error, other container controls). Part of it, I have a piece of code which clears out the old images first:

procedure TfrmImageView.Clear;
begin
while sbImages.ControlsCount > 0 do
sbImages.Controls[0].DisposeOf;
end;

This works perfectly on Windows. However, when I run it on an iPad, it gets stuck in a continuous loop, because for some reason ControlsCount is always 1. In fact, this happens even when I have never put any controls in there in the first place.

Why is this reporting always 1 control?

Comments are closed.