iOS Question AS_TabMenuAdvanced middle button icon

epneeh

Member
Licensed User
Longtime User
Hello, i'm porting my established android app to ios app, my app is using AS_TabMenuAdvanced which is working fine on android, unfortunately there's crash when setbitmap on middle icon

B4X:
Dim wi As Int =tabMenu.MiddleButtonLabel.Width
    Dim he As Int =tabMenu.MiddleButtonLabel.Height
    tabMenu.MiddleButtonLabel.SetBitmap(LoadBitmapResize(File.DirAssets,"fr.png",wi,he,True))

error:
Copying updated assets files (1)
Application_Start
init db
Application_Active
FCMConnected
Class (b4i_httpjob) instance released.
Class (b4i_ihttpclient) instance released.
Class (b4i_httpjob) instance released.
Error occurred on line: 483 (AS_TabMenuAdvanced)
Type does not match (UILabel)
Stack Trace: (
  CoreFoundation       __exceptionPreprocess + 242
  libobjc.A.dylib      objc_exception_throw + 62
  CoreFoundation       -[NSException initWithCoder:] + 0
  HADIRKU              -[B4XViewWrapper throwTypeDoesNotMatch] + 90
  HADIRKU              -[B4XViewWrapper SetBitmap:] + 195
  CoreFoundation       __invoking___ + 140
  CoreFoundation       -[NSInvocation invoke] + 302
  HADIRKU              +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1519
  HADIRKU              -[B4IShell runVoidMethod] + 184
  HADIRKU              -[B4IShell raiseEventImpl:method:args::] + 1696
 HADIRKU              -[B4IShellBI raiseEvent:event:params:] + 1354
 HADIRKU              -[b4i_fmhome _show] + 158
 HADIRKU              -[ResumableSub_main_initApp resume::] + 4616
 CoreFoundation       __invoking___ + 140
 CoreFoundation       -[NSInvocation invoke] + 302
 HADIRKU              +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1519
 HADIRKU              -[B4IShell runMethod:] + 384
 HADIRKU              -[B4IShell raiseEventImpl:method:args::] + 2098
 HADIRKU              -[B4IShellBI raiseEvent:event:params:] + 1354
 HADIRKU              -[B4IDelegatableResumableSub resume::] + 366
 HADIRKU              -[B4I checkAndRunWaitForEvent:event:params:] + 482
 HADIRKU              -[B4IShellBI raiseEvent:event:params:] + 1205
 HADIRKU              __37-[B4ICommon ReturnFromResumableSub::]_block_invoke + 279
 libdispatch.dylib    _dispatch_call_block_and_release + 12
 libdispatch.dylib    _dispatch_client_callout + 8
 libdispatch.dylib    _dispatch_main_queue_drain + 1417
 libdispatch.dylib    _dispatch_main_queue_callback_4CF + 31
 CoreFoundation       __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
 CoreFoundation       __CFRunLoopRun + 2515
 CoreFoundation       CFRunLoopRunSpecific + 536
 GraphicsServices     GSEventRunModal + 137
 UIKitCore            -[UIApplication _run] + 875
 UIKitCore            UIApplicationMain + 123
 HADIRKU              main + 104
 dyld                 start_sim + 10
 ???                  0x0 + 4645122885
)
Class (b4i_ihttpclient) instance released.

any idea?
 

Alexander Stolte

Expert
Licensed User
Longtime User
MiddleButtonLabel.SetBitmap
Its a label and not a image view. You cant add images to a label.
Follow this example:
 
Upvote 0

epneeh

Member
Licensed User
Longtime User
Its a label and not a image view. You cant add images to a label.
Follow this example:

thanks for reply, i already check custom middle button, but none say it can add image

Untitled.png


this is a preview from same library on android, i know it is a label, on b4a it is version 1.11 on b4i it is version 1.17, but on android it is work adding image to middle button
 
Upvote 0
Top