iOS Question What is wrong with the B4i code of this class

Discussion in 'iOS Questions' started by hatzisn, Aug 14, 2019.

  1. hatzisn

    hatzisn Active Member Licensed User

    Hi everybody,

    I have posted this post in the forum but I suppose I have posted in the wrong forum since I also want some help.

    What is wrong with the code in CreateStep sub and the same code works for Android but not for iOS (it doesn't draw the picture you see in the previous link but no errors exist in the IDE).

    Thanks in advance
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is a mistake to post a non-working library.

    Create a small project that demonstrates the issue and upload it.
  3. hatzisn

    hatzisn Active Member Licensed User

    You are right. My mistake... Please delete the post in b4i libraries forum as I cannot.
    Here is a project demonstrating the non-working class in b4i. If you migrate the project to B4A the same code works perfectly (as seen in the other - to be deleted - post).

    Attached Files:

      File size:
      64.4 KB
  4. Erel

    Erel Administrator Staff Member Licensed User

    1. You should never use percentage units outside of the resize event:
    p.Height = 100%y
       p.Width = 
    Worth watching this video tutorial:

    2. This is not needed:
    #if b4a
           lNext.TextSize = iNavFontSize
           lBack.TextSize = iNavFontSize
           lExplain.TextSize = ExplanationFontSize
           lNext.Typeface = 
           lBack.Typeface = 
           lExplain.Typeface = 
           lExplain.SingleLine = 
    #else if b4i
       lNext.Font = lNext.Font.CreateNewBold(iNavFontSize)
       lBack.Font = lBack.Font.CreateNewBold(iNavFontSize)
       lExplain.Font = lBack.Font.CreateNew(ExplanationFontSize)
    All Labels should be converted to B4XView and you should use XUI.CreateFont.

    3. You should use B4XCanvas instead of Canvas.
    4. Make sure to call B4XCanvas.Invalidate when done drawing.
    5. Make sure to call B4XCanvas.Release when done with the canvas.
    6. It is better to reuse the canvases instead of creating new ones each time.
    anOparator likes this.
  5. hatzisn

    hatzisn Active Member Licensed User

    Erel likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice