iOS Question Add Line and Bitmap

Che Mohamad

Member
Licensed User
Hi,
I use B4i version 8.51 and Mac builder server.
The below code runs smoothly when I use " Build B4i brige app", however nothing appear when I use Build Release App.
The purpose of the code is to display Menu item with bitmap.

Whats could be wrong?

B4X: Copy
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
    Private clv1 As CustomListView
    Private dd As DDD
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
    dd.Initialize
    xui.RegisterDesignerClass(dd)
    Root = Root1
    Root.LoadLayout("layCLV")
    clv1.Add(CreateListItem("Menu Item 1", clv1.AsView.Width, 60dip,"menuitem.png"),"Menu Item 1")
End Sub


Private Sub CreateListItem(Text As String, Width As Int, Height As Int, Icon As String) As B4XView
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, Width, Height)
    p.LoadLayout("layMainMenu")
    
    dd.GetViewByName(p, "ImageView1").setBitmap(LoadBitmap(File.DirAssets ,Icon ))
    
    dd.GetViewByName(p, "Label1").Text = Text

    Return p
End Sub
 
Build release app, does not run the app on your phone. You need to download the archive.zip from the server (assuming you are using hosted builder)
 
Upvote 0
After completing the build release app, I "Download Last Build", posted the IPA file to diawi.com and download the app to my iphone 15.
The code that I have posted is only part of larger code. Its works for other page. Only this one doesnt work.
I suspect its due to DDD class on the MAC builder server, but not sure about it.
 
Upvote 0
Hi Erel,
Attached pls find the small project's zip file.
It works in debug mode, but failed in release mode
Thank you in advance for your help.
 

Attachments

Upvote 0
Two things:
1. The file name case must be correct.
2. I noticed that three of the images have the PNG extension although they are actually JPEGs. I've changed their extension and it started working.
I guess that Xcode tries to compress the images in an incompatible way and breaks them when the extension was wrong (in debug mode the images are handled in a different way).
 
Upvote 0
HI Erel,
Thanks. Its working now.
Btw I noticed the Mac builder servers (both primary and secondary) always slow between 4pm-5.30PM GMT+8 time.

I can be sure that its not due to my internet slow connection.
Hope you can look into it.

Regards,
 
Upvote 0
Back
Top