iOS Question How to set B4i app fullscreen?

capisx

Member
Licensed User
I can hide the navigation bar but how to make my app fullscreen in B4i? (hiding the iOS status bar on top of screen)
 

netkomm

Active Member
Licensed User
1. Add this attribute:
B4X:
#PlistExtra: <key>UIViewControllerBasedStatusBarAppearance</key><false/>
2. Add this code:
B4X:
Dim no As NativeObject = app
no.RunMethod("setStatusBarHidden:animated:", Array(True, False))

When I add this code to my app I get this error (using B4I 4.4 beta)

B4X:
Application_Start
Error occurred on line: 60 (Main)
Method not found: setStatusBarHidden:animated:, target: <B4INavigationController: 0x14400ba00>
Stack Trace: (
  CoreFoundation       <redacted> + 148
  libobjc.A.dylib      objc_exception_throw + 56
  CoreFoundation       <redacted> + 0
  PEAKS Profile        +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 388
  PEAKS Profile        -[B4INativeObject RunMethod::] + 216
  PEAKS Profile        -[b4i_main _application_start:] + 5840
  CoreFoundation       <redacted> + 144
  CoreFoundation       <redacted> + 292
  PEAKS Profile        +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
  PEAKS Profile        -[B4IShell runMethod:] + 448
 PEAKS Profile        -[B4IShell raiseEventImpl:method:args::] + 1784
 PEAKS Profile        -[B4IShellBI raiseEvent:event:params:] + 1408
 PEAKS Profile        __33-[B4I raiseUIEvent:event:params:]_block_invoke + 60
 libdispatch.dylib    <redacted> + 24
 libdispatch.dylib    <redacted> + 16
 libdispatch.dylib    <redacted> + 968
 CoreFoundation       <redacted> + 12
 CoreFoundation       <redacted> + 2012
 CoreFoundation       CFRunLoopRunSpecific + 436
 GraphicsServices     GSEventRunModal + 100
 UIKit                UIApplicationMain + 208
 PEAKS Profile        main + 124
 libdyld.dylib        <redacted> + 4
)
refreshPreferences: HangTracerEnabled: 0
refreshPreferences: HangTracerDuration: 500
refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
Application_Active
 

netkomm

Active Member
Licensed User
ok, I solved it.

The method used is "deprecated".

B4X:
no.RunMethod("setStatusBarHidden:withAnimation:", Array(true,False))
works, instead.
 
Top