i show a second page with modal presentation. as you can see in the picture the top part is blank and the value y0 does not start from the top. it starts about 20-30 pixel below. now i guess its the place for the toolbar but i dont show any tool bar in my navigationcontroller. is it possible to show on 1 page a toolbar and on another no toolbar?
i would like to fill that place with something like a label with a title but i cannot do it. so i thought i could show the toolbar but i only want to do that when the second page is showing. do i have to use another navigation controller and add that page to that navigation controller?
this is the code to show the second page:
B4X:
Public Sub PresentPage2(Parent As Page, dialog As Page)
Dim no As NativeObject = dialog
no.SetField("modalTransitionStyle",0)
Dim no2 As NativeObject = Parent
no2.RunMethod("presentViewController:animated:completion:", Array(dialog, True, Null))
End Sub
if you can remember some time ago i asked for an option to decrease the lines in the process global section and you wrote that if i have so many objects and views i probably am doing something wrong and i should separate them in different classes and pages. so thats what i did. instead of adding all panels and views in a single layout or class i am using now multiple pages and classes.
its simpler like this to find bugs and understand the code.
a lot of apps use that kind of modal presentation and i also want to do it in my apps. the problem is only that the top part of the page is blank and that i cannot put any view in that place in my layout.
if you can remember some time ago i asked for an option to decrease the lines in the process global section and you wrote that if i have so many objects and views i probably am doing something wrong and i should separate them in different classes and pages. so thats what i did. instead of adding all panels and views in a single layout or class i am using now multiple pages and classes.
its simpler like this to find bugs and understand the code.
Correctly using classes has nothing to do with this. I haven't recommended you to use multiple pages only to use multiple classes.
You can implement the dialog in its own class.
i still like the way of the modalTransitionStyle. it is used a lot now in a lot of apps and you can also dismiss it by swiping down. it runs very smooth so i would like to use it.
do you have a solution for the missing part at the top?
thank you for your help erel, i tried several options but unfortunately nothing solved the issue.
if you have time you can have a look at the example i attached.
the result should be like this:
as you can see the top has a view in it. i am not sure if it is a panel with views inside or a toolbar. but in b4i what i get is an empty space even if i use NavControl.NavigationBarVisible = True.
The gap that you see is related to the way the page relates to the status bar. The simplest solution is to make the page color transparent and add a new panel (pnlRoot) that with a solid color. See the attached example.