iOS Question Change top and bottom bars color

jaraiza

Active Member
Licensed User
Longtime User
Hi,

Is there any way to change both bars colors? My main Page's color is yellow, and since those bars are gray I was asked to change them :confused:

Thanks!
 

jaraiza

Active Member
Licensed User
Longtime User
This indeed worked for navigationBar, but toolbar didn't change (not even with translucent)


B4X:
Dim OBJNavBar As NativeObject = NavControl
OBJNavBar.GetField("navigationBar").RunMethod("setBarTintColor:", Array(OBJNavBar.ColorToUIColor(Colors.Yellow)))
OBJNavBar.GetField("navigationBar").SetField("translucent", False)
   
Dim OBJToolBar As NativeObject = NavControl
OBJToolBar.GetField("toolbar").RunMethod("setBarTintColor:", Array(OBJToolBar.ColorToUIColor(Colors.Yellow)))
OBJToolBar.GetField("toolbar").SetField("translucent", False)

I tried to use "Toolbar", "toolBar" and "ToolBar" just in case, but all of those thrown not-exist errors.

Kf4QZjy.jpg
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code works:
B4X:
  Dim OBJNavBar As NativeObject = NavControl
   OBJNavBar.GetField("toolbar").RunMethod("setBarTintColor:", Array(OBJNavBar.ColorToUIColor(Colors.Yellow)))
   OBJNavBar.GetField("navigationBar").RunMethod("setBarTintColor:", Array(OBJNavBar.ColorToUIColor(Colors.Yellow)))
   OBJNavBar.GetField("navigationBar").SetField("translucent", False)
 
Upvote 0

jaraiza

Active Member
Licensed User
Longtime User
I'm testing the code in an iPad Air (iOS 7) and I got the same result as the picture I uploaded before, the bottom bar is still gray :(
 
Upvote 0

jaraiza

Active Member
Licensed User
Longtime User
Unless there's a bug in iOS 7.1.2 I'm out of answers :(

Here is the (unlisted) video on youtube:

 
Upvote 0
Top