iOS Question AddMap in Page_Resize event in a second page - Page_Resize not fires the 2nd time

hatzisn

Well-Known Member
Licensed User
Here is the situation:

I have a Google Map in a second page. The project is not B4XPages but a simple one.
The first time I call page2.Show the Page_Resize event fires and in it I call the AddMap sub (as seen in Google Maps tutorial) but if I exit the current page and reenter the Page_Resize event does not fire and the Map is not added resulting in a blank panel.

I tried to move the AddMap sub call in page_Appear and after the page.Rootpanel.Loadlayout("....") but the panel the map is added in, is not resized properly (maybe yet).
How to overcome this problem (maybe force fire of Resize_Event everytime) ?
 

hatzisn

Well-Known Member
Licensed User

Attachments

  • Page_Resize_Test_2nd_Page.zip
    4.5 KB · Views: 22
Upvote 0

hatzisn

Well-Known Member
Licensed User
Disable the layout's AutoScaleAll

Good evening, thanks for answering. This was not the answer but I 've managed to fix it. I removed the IF - END IF lines in the Show sub and it works perfect - at least it appears to do so until a new notice.
 

Attachments

  • Page_Resize_Test_2nd_Page.zip
    4.5 KB · Views: 21
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
A behaviour is expected. Unlike Android, all pages are in memory. If to show a page the second time, a size of page is not changed (and there is no Page_Resize event).
You can do something like in attached sample. 'CorrectLayout' is called every time.
 

Attachments

  • Page_Resize_Test_2nd_Page.zip
    4.6 KB · Views: 21
Upvote 0
Top