iOS device rotation and TableView

Hello,

 
I am using a TableView with multiple DetailViews on an iPhone.
The OnResize event of the MainForm is used to adapt the layout of the TableView to
the current device orientation like:
 
TableView.Width := frmMain.ClientWidth;
TableView.Height := frmMain.ClientHeight;
 
Unfortunately whenever that happens the currently visible DetailView gets behind the root TableView.
How can I prevent this change of the z order or how can I restore the correct z order?
 
best regards,
 
Thomas
 

You can try with this trick, to hide the detailview and reshow it after the resize:


  TMSFMXTableView1.Items[0].HideDetailView;
  TMSFMXTableView1.Width := 100;
  TMSFMXTableView1.Items[0].ShowDetailView;

Kind Regards, 
Pieter

Hello Pieter,

 
Yes, that is indeed a possible solution.
But I have lots of different controls/tableviews that could be active.
So I have in the Mainform just FCurrentControl: TControl which points to the active TableView (or another control).
I resize this control in the OnResize event of frmMain.
I actually don't (want to) know about the internals of that control.
Should a control not know by itself what the correct z order (state) of included child controls is?
Otherwise I would need lots of knowledge about the internals of that control which should not
be required.
 
best regards,
 
Thomas
   

I have looked in to this and was applied to fix the issue. The fix will be available in the next release.


Kind Regards, 
Pieter

Hello Pieter,

 
I think with this change a new bug was introduced.
If (with the current version 1.1.2.3) you select an Item in a TableView which has NO DetailView connected
and then you resize the whole TableView all the content (all Items) of the TableView suddenly vanishes.
Let me know if you really need an example but I think this is very easy to reproduce.
 
best regards,
 
Thomas 
Hi Thomas, 

You are correct, we are able to reproduce this issue here and there are some additional checks that need to be done. We have now investigated and retested this here and have applied a fix for this issue. The fix will be available in the next release.

Thanks for the feedback, 

Pieter


Hello Pieter,

 
do you have an estimation when the release with this fix will be available?
 
best regards,
 
Thomas

Hi, 


We have recently done some intense and new development that kept us from updating the firemonkey components. At the end of this week the update should be available. If not, or when urgent ask us for a source update through direct email when necessary.

Kind Regards, 
Scheldeman Pieter

Hello Pieter,

 
congratulations, the new cross platform grid looks awful!
Also thank you for the fix concerning the TableView.
 
Unfortunately there is a new bug in the TableView.
The TableView dosn't scroll any more to items not shown in the View.
At least on iOS and in the XCode simulator, on Windows scrolling works fine.
You can see that when you add some more rows to your iOS  "Overview Demo"
I just expanded the loop a bit like that, to get some more items in the main view:
 
  for I := 0 to TMSFMXBitmapContainer1.Items.Count - 1 do
  begin
    with TMSFMXTableView1.Items.Add do
    begin
      CategoryID := TMSFMXBitmapContainer1.Items.Tag;
      Caption := TMSFMXBitmapContainer1.Items.Name;
      BitmapName := Caption;
      if (I = 3) or (I = 2) or (I = 7) then
      begin
        DetailView := TMSFMXTableView2;
        Randomize;
        BulbText := inttostr(Random(10) + 5);
        DataObject := TList.Create;
      end;
    end;
    with TMSFMXTableView1.Items.Add do
    begin
      CategoryID := TMSFMXBitmapContainer1.Items.Tag + 100;
      Caption := TMSFMXBitmapContainer1.Items.Name + IntToStr(TMSFMXBitmapContainer1.Items.Tag);
      BitmapName := Caption;
      if (I = 3) or (I = 2) or (I = 7) then
      begin
        DetailView := TMSFMXTableView2;
        Randomize;
        BulbText := inttostr(Random(10) + 5);
        DataObject := TList.Create;
      end;
    end;
  end;
 
In the XCode iOS simulator I can't scroll past "Cherry3" in iPad Landcape mode, the TableView just stops scrolling.
 
best regards,
 
Thomas 

Sorry, there was a bug in the souce code, it should look like this (in fact it doesn't matter for the problem):

for I := 0 to TMSFMXBitmapContainer1.Items.Count - 1 do
begin
with TMSFMXTableView1.Items.Add do
begin
CategoryID := TMSFMXBitmapContainer1.Items.Tag;
Caption := TMSFMXBitmapContainer1.Items.Name;
BitmapName := Caption;
if (I = 3) or (I = 2) or (I = 7) then
begin
DetailView := TMSFMXTableView2;
Randomize;
BulbText := inttostr(Random(10) + 5);
DataObject := TList.Create;
end;
end; with TMSFMXTableView1.Items.Add do
begin
CategoryID := TMSFMXBitmapContainer1.Items.Tag;
Caption := TMSFMXBitmapContainer1.Items.Name + IntToStr(TMSFMXBitmapContainer1.Items.Tag);
BitmapName := Caption;
if (I = 3) or (I = 2) or (I = 7) then
begin
DetailView := TMSFMXTableView2;
Randomize;
BulbText := inttostr(Random(10) + 5);
DataObject := TList.Create;
end;
end; end;
 
best regards,
 
Thomas

is this based on the latest version v1.5 of the TMS Pack for FireMonkey?

Hello,
 
Yes, this is about version 1.5!
 
best regards,
 
Thomas

We will investigate this.

We have investigated this here and are able to reproduce this here however this might be an iOS issue that doesn't trigger the correct event for updating the tableview as it resizes.


There are a couple of steps to try and fix the issue:

Call TMSFMXTableView1.UpdateStyle in the form resize event.

Set the TMSFMXTableView1.BufferSize to a higher number (exceed the visible item count in landscape mode)

or a combination of the two.

Since it doesn't occur on windows it will be hard to debug this issue since xcode doesn't allow us to debug inside the delphi source code.

Kind Regards, 
Scheldeman Pieter