iOS Question Problem getting height of NavigationBar ?

henrywood

Active Member
Licensed User
I am trying to get the height of the NavigationBar (don't want to hardcode any values).
I've tried:

B4X:
  Dim NativeMe2 As NativeObject = Main.NavControl
  ' self.navigationController.navigationBar.frame.size.height;
  Dim NativeMe3 As NativeObject = NativeMe2.GetField("navigationBar").GetField("frame").GetField("size").GetField("height")
  Dim h As Object = NativeMe3.AsNumber
I am getting this error:

Application_Start
Application_Active
Error occurred on line: 110 (modshare)
[<NSConcreteValue 0x17d5b350> valueForUndefinedKey:]: this class is not key value coding-compliant for the key size.
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
Foundation <redacted> + 262
Foundation <redacted> + 202
Share Test -[B4INativeObject GetField:] + 124
Share Test -[b4i_modshare _sharetosocialmedia:::::] + 1594
Share Test -[b4i_main _cmdsharelocalimage_click] + 1328
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
Share Test +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1928
Share Test -[B4IShell runMethod:] + 496
Share Test -[B4IShell raiseEventImpl:method:args::] + 1846
Share Test -[B4IShellBI raiseEvent:event:params:] + 1316
Share Test __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib <redacted> + 1322
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1512
CoreFoundation CFRunLoopRunSpecific + 476
CoreFoundation CFRunLoopRunInMode + 106
GraphicsServices GSEventRunModal + 136
UIKit UIApplicationMain + 1440
Share Test main + 108
libdyld.dylib <redacted> + 2
)
Any ideas what's wrong ?


/Henrik
 

henrywood

Active Member
Licensed User
Well the code is in a shared, reusable code module so all code related to the functionality of the shared module should be contained within it.
But did you mean to say that you can have multiple Page_Resized Handlers in multiple code modules ?
 
Top