Transparent Page

Discussion in 'iOS Code Snippets' started by narek adonts, Mar 3, 2015.

Similar threads

B4i Code Snippet CSBuilder text direction
B4i Tutorial Notifications with actions
B4J Code Snippet [B4X] Trust all SSL Socket
B4i Code Snippet WebView "extra"
B4i Code Snippet Full screen apps
  1. narek adonts

    narek adonts Well-Known Member Licensed User

    Code to show a page with transparent background (or Alpha).
    That means that the page under will be visible.


    You need to change the NewPage background color to transparent or any alpha to see the effect.

    Code:
    Private Sub ShowPage(Parent as Page, NewPage as Page)

           
    Dim no As NativeObject = Parent
           
    Dim no2 As NativeObject=NewPage

           no2.SetField(
    "ModalTransitionStyle",0)   'You can change the animations style by changeing the 0 to 1,2,...

    no.SetField(
    "providesPresentationContextTransitionStyle",True)
    no.SetField(
    "definesPresentationContext",True)
    no2.SetField(
    "ModalPresentationStyle",5)  ' You can change the mode by changing the 5 to 6,7,..

    no.RunMethod(
    "presentModalViewController:animated:",Array(NewPage,True))

    ' you can disable the animation by setting false

    End Sub



    Private Sub HidePage(Parent as Page)

            
    Dim no As NativeObject=Parent
        no.RunMethod(
    "dismissViewControllerAnimated:completion:",Array(True,Null))
    'you can disable the animation by setting false
    End Sub
    You can change a lot of Styles.

    Narek
     
    Pooya1, Keith Yong, moore_it and 3 others like this.
  2. Keith Yong

    Keith Yong Active Member Licensed User

    Narek, you are very very helpful! I have been looking for it 2 weeks and keep searching around. Because I planning to create a custom alert message which need to be cover the whole page (including the navigation bar and status bar). thank you!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice