iOS Question Status Bar, I need to customize color and remove bottom controls

Discussion in 'iOS Questions' started by b4xscripter, May 15, 2018.

  1. b4xscripter

    b4xscripter Member Licensed User

    Hi,

    I have a question related to the status bar's color. I have this code:

    Code:
    'Code module
    #Region  Project Attributes 
        
    #ApplicationLabel: MSA2
        
    #Version: 0.0.4 
        
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
        #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
        
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
        
    #Target: iPhone, iPad
        
    #ATSEnabled: True
        
    #MinVersion: 7
    '    #Entitlement: <key>aps-environment</key><string>production</string>
    #End Region

    #If RELEASE
       #CertificateFile: ios_distribution.cer
       #ProvisionFile: store.mobileprovision
    #END IF

    Sub Process_Globals
        
    'These global variables will be declared once when the application starts.
        'Public variables can be accessed from all modules.
        Public App As Application
        
    Public NavControl As NavigationController
       
        
    Private Page1 As Page

        
    Private location As Button
    End Sub

    Private Sub Application_Start (Nav As NavigationController)
        NavControl = Nav
        
    Dim no As NativeObject = NavControl

        no.GetField(
    "navigationBar").RunMethod("setBarStyle:"Array(1))
        no.GetField(
    "navigationBar").SetField("barTintColor", no.ColorToUIColor(Colors.ARGB(255,33,150,243)))
        Page1.Initialize(
    "Page1")
        Page1.RootPanel.LoadLayout(
    "1")
       
        NavControl.ShowPage(Page1)
        Page1.TopRightButtons = 
    Array( _
            CreateFABarButton(
    Chr(0xE0C8), "addAlert") _
            ,CreateFABarButton(
    Chr(0xE8B6), "find"))
        NavControl.ToolBarVisible = 
    True
    End Sub

    Private Sub Page1_BarButtonClick (Tag As String)
        
    'toolbar events
        Log(Tag & " was clicked toolbar events")
    End Sub


    Private Sub BarButton_Click
        
    Dim b As Button = Sender
        
    Log(b.Tag & " was clicked!!!!!")
    End Sub

    Private Sub CreateFABarButton(text As String, tag As Object) As BarButton
        
    Dim bb As BarButton
        
    Dim b As Button
       
        b.InitializeCustom(
    "BarButton"0xFFFFFFFF0xFFFFFFFF)
        b.CustomLabel.Font = 
    Font.CreateNew2("Material Icons"24)
        b.Text = text
        b.Tag = tag
        b.SetLayoutAnimated(
    01003040)
        bb.InitializeCustom(b)
        
    Return bb
    End Sub


    Private Sub Page1_Resize(Width As Int, Height As Int)
       
    End Sub

    Private Sub Application_Background
       
    End Sub
    Everythings works OK but I just need to change the status bar color and remove the bottom controls, as it is shown in the picture attached. Can anyone help me how to do that?
    Many thanks!


    upload_2018-5-15_12-26-52.png
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. b4xscripter

    b4xscripter Member Licensed User

    Thank you, Erel!
    For the second question, it is OK!
    For the first one...
    I read the post you've meant, I saw that it's about the code:

    Code:
    Dim no As NativeObject = App
    no.RunMethod(
    "setStatusBarStyle:"Array(1))
    But what I want is to have the status bar in a different color, let's suppose, yellow. How to do it?

    As in your first post, I put this as well:

    Code:
    #PlistExtra: <key>UIViewControllerBasedStatusBarAppearance</key><false/>

    upload_2018-5-15_15-40-32.png

    Thank you for your help!

    Best regards
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    It is not possible to change the color without using private APIs that are likely to cause your app to be rejected.
     
  5. b4xscripter

    b4xscripter Member Licensed User

    ok, thank you, Erel!

    Best regards
     
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