Hi everybody!
I've a Toolbar with some pages. Each TabBarItem in Pages is a NavigationController. I set TintColor in each NavController using this code
and it works. This is the preview
Now, when click on Bar Button i need to show a page that is not stored in main ToolbarPages. So i do this, and it works:
My issue now is this
I'm not able to change Color of Back Button. If is possible, i want also to ellips back button name, to mantain Title in center.
When i try to RunMethod SetBarTintColor i get
Anyone can help me? Thanks!
I've a Toolbar with some pages. Each TabBarItem in Pages is a NavigationController. I set TintColor in each NavController using this code
B4X:
Dim no As NativeObject = n
no.GetField("navigationBar").RunMethod("setBarTintColor:", Array(no.ColorToUIColor(0xfff7f7f7)))
no.GetField("navigationBar").SetField("translucent", False)
no.GetField("navigationBar").RunMethod("setBarStyle:", Array(0))
and it works. This is the preview
Now, when click on Bar Button i need to show a page that is not stored in main ToolbarPages. So i do this, and it works:
B4X:
Sub BarButton_Click
Dim info As Informazioni
Utils.HoldReference = info
info.Initialize(Me)
Dim nav As NavigationController = Main.tbc.Pages.Get(Main.tbc.SelectedIndex)
nav.ShowPage2(info.GetPage,True)
End Sub
My issue now is this
I'm not able to change Color of Back Button. If is possible, i want also to ellips back button name, to mantain Title in center.
When i try to RunMethod SetBarTintColor i get
B4X:
Application_Start
Device locale: en
Found 49 strings.
loc en
Found 49 strings.
loc EN
Application_Active
Error occurred on line: 19 (Informazioni)
[<B4IViewController 0x7bf92d40> valueForUndefinedKey:]: this class is not key value coding-compliant for the key navigationbar.
Stack Trace: (
CoreFoundation __exceptionPreprocess + 189
libobjc.A.dylib objc_exception_throw + 49
CoreFoundation -[NSException raise] + 17
Foundation -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 232
Foundation _NSGetUsingKeyValueGetter + 146
Foundation -[NSObject(NSKeyValueCoding) valueForKey:] + 276
B4i Example -[B4INativeObject GetField:] + 163
CoreFoundation __invoking___ + 29
CoreFoundation -[NSInvocation invoke] + 321
B4i Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1842
B4i Example -[B4IShell runMethod:] + 525
B4i Example -[B4IShell raiseEventImpl:method:args::] + 1881
B4i Example -[B4IShellBI raiseEvent:event:params:] + 1915
B4i Example __33-[B4I raiseUIEvent:event:params:]_block_invoke + 67
libdispatch.dylib _dispatch_call_block_and_release + 15
libdispatch.dylib _dispatch_client_callout + 14
libdispatch.dylib _dispatch_main_queue_callback_4CF + 1053
CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
CoreFoundation __CFRunLoopRun + 2445
CoreFoundation CFRunLoopRunSpecific + 372
CoreFoundation CFRunLoopRunInMode + 123
GraphicsServices GSEventRunModal + 71
GraphicsServices GSEventRun + 80
UIKit UIApplicationMain + 148
B4i Example main + 140
libdyld.dylib start + 1
)
Anyone can help me? Thanks!