iOS Question Center vertically text in BBCodeView

asales

Expert
Licensed User
Longtime User
I come from this thread "Center vertically text in BBCodeView".
It works in B4A but not in B4i.

I just change to pass the parameter base, because I use the BBCodeView in a panel.
B4X:
Private Sub SetBBCodeViewPosition(base As B4XView)
    If BBCodeView1.Paragraph.IsInitialized Then
        Dim ContentHeight As Int = Min(BBCodeView1.Paragraph.Height / TextEngine.mScale + BBCodeView1.Padding.Top + BBCodeView1.Padding.Bottom, BBCodeView1.mBase.Height)
        BBCodeView1.mBase.Height = ContentHeight
        BBCodeView1.mBase.Top = base.Height / 2 - ContentHeight / 2
    End If
End Sub

I don't found this option in BBCodeView.

How to make it works in B4i?

Thanks in advance for any tips.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
I can't give you any hints on B4i, but instead of moving the base, I add a view (pane/panel) at the start of the page
and adjusts its height to where I want the text to start - this works for any vertical positioning.
 
Upvote 0
Top