iOS Question Resize properly a panel if navigation bar is visible

hatzisn

Expert
Licensed User
Longtime User
Hi everyone,

I just ran in a dead end which I cannot overcome. Applying my what's new library (as seen in the libraries of the forum) to an iOS app I noticed that by setting the dimensions to the Width and Height in the resize event, it gets the dimension of the full screen. If the Navigation Bar is visible then the lower part of the panel is not visible and thus the labels of the navigation. Is there a way to check if the Navigation Bar is visible and reset the dimensions of the screen properly in order for the panel to fit perfectly in the rest of the area?

Thanks in advance
 

hatzisn

Expert
Licensed User
Longtime User
Hi Erel, I have managed to get the rectangle of the navigation bar in the resize event and have set this to a rectangle (Type Rect in B4i).
When I try to get the rect.Bottom it gives me an error but if I log the rect in the logs I can see its dimensions as well as the Height in resize event. This though has slapped me in the face big time because the height mentioned in the resize event is the height without the NavigationBar and the ribbon with the informations on the top (SIM-Network-time etc.). I completely don't get it because this can't be true as the what's new class does not appear correctly.

So I would like to ask 2 questions:
1) How can I get the Bottom property of the rect without an error
2) Have I understood wrong and the dimensions of the Resize Event do not correspond to the screen without navigationbar and ribbon?


Edit: if you set navigationbarvisible to false it displays again the rectangle of the navigationbar but it sets its position over and out of the screen (over dimension is as long as the height). So the second values in rectangle correspond to (Width, Height)

(the code follows attached - try to turn the screen to activate the resize event)
 

Attachments

  • NavBarDimensions.zip
    1.3 KB · Views: 181
Last edited:
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
False alarm about the What's new library. I was calling the SetDimensions function from another sub that was being called in Application_Start and thus the Page1_Resize hadn't been fired to get the actual values of the available screen. Question 2 has been answered. In Page1_Resize you get the dimensions of the screen without navigation bar and top ribbon - thus the rest of the screen.

For the shake of knowledge though, what about question number 1?
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Thank you Erel. Can you also clarify why I cannot get the Bottom property as seen in the code attached above? Is type Rect of B4i a wraper for NSRect in iOS and it is not possible thus to access its properties directly? If so, why does it cast it to Rect and it does not give an error?
 
Upvote 0
Top