iOS Question Confused about navigation bar color

tufanv

Expert
Licensed User
Longtime User
Hello,

I was using xcode 13 and ios 15 with local builder and I was using the below code to set nav color:

NavControl.As(NativeObject).GetField("view").As(B4XView).Color = xui.Color_RGB(25,25,25)

I switched to remote hosted builder, and my nav color is different than what I set. Does it because hosted builder is not running on xcode 13? I am using b4i 7.80. How must I handle this, sometimes I use hosted buidler and sometimes I use local builder ?

Tufan
 

jahswant

Well-Known Member
Licensed User
Longtime User
Hello,

I was using xcode 13 and ios 15 with local builder and I was using the below code to set nav color:

NavControl.As(NativeObject).GetField("view").As(B4XView).Color = xui.Color_RGB(25,25,25)

I switched to remote hosted builder, and my nav color is different than what I set. Does it because hosted builder is not running on xcode 13? I am using b4i 7.80. How must I handle this, sometimes I use hosted buidler and sometimes I use local builder ?

Try this :

B4X:
SetNavColors(0xFF00BCD4)

Public Sub  SetNavColors(clr As Int)
    Try
        Dim no As NativeObject = NavControl
        no.GetField("navigationBar").RunMethod("setBarTintColor:", Array(no.ColorToUIColor(clr)))
        no.GetField("view").As(View).Color = clr
        no.GetField("navigationBar").RunMethod("setTintColor:", Array(no.ColorToUIColor(clr)))
    Catch
        Log(LastException)
    End Try
End Sub
 
Upvote 0
Top