B4A Library [B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View - Erel    
Mar 22, 2026   
(74 reactions)   
tags: Label BBCode, text style, RTF component, B4X, ritchtext, rich text parser.
- Two custom views that connect everything:
BBCodeView - multiline, scrollable with support... control over the text drawing.
I will explain the main use case of BBCodeView.
Our layout is usually made...
link: - v1.97 - Fixes an issue with ordered lists where the font style wasn't set properly....
link: - v1.96 - Fixes an issue caused by rounding errors related to the device scale calculations. Mainly ...
link: with BBCodeView.ScrollToAnchor.
142185
See attached example....
B4A Tutorial [B4X] BBCodeView Anchors Example - Erel    
May 24, 2023   
(5 reactions)142262 142263
A small, cross platform, example of using the new anchors feature of BBCodeView.
It reads a CSV file with information about US politicians. The data is used to populate a BBCodeView and B4XDialog+B4XSearchTemplate.
The bbcode looks like:
For Each pol As Politician In politicians....DialogResponse_Positive Then
BBCodeView1.ScrollToAnchor(SearchTemplate.SelectedItem)
End If
End Sub
The generated bbcode text can get quite large. I wouldn't use BBCodeView like...
B4J Code Snippet [B4X] SMM + BBCodeView - a great pair - Erel    
Sep 1, 2022   
(12 reactions) simple to combine it with BBCodeView and easily embed media inside rich text:
BBCodeView1.Text..., 0, Width, Height)
SMM.SetMedia(pnl, URL)
Dim name As String = "view" & BBCodeView1.Views.Size
BBCodeView1.Views.Put(name, pnl)
Return $""$
End Sub...
B4A Question [Solved] Center vertically text in BBCodeView - Toky Olivier    
Jan 29, 2020I did many attemps to center vertically text in BBCodeView when paragraph height is not larger than... is centered vertically but in a BBCodeView. I picked code from BBLabel (from the Redraw sub) but always...
link: I come from this thread "Center vertically text in BBCodeView".
It works in B4A but not...
link: It worked. Thanks!...
link: 168532
Put the BBCodeView inside a panel.
Private Sub SetBBCodeViewPosition
If BBCodeView1...
Bug? Uneven line spacing inside BBCodeView paragraph (No Bug - My Error) - William Lancee    
May 3, 2023In the image below the A line spacing is only 80% of the B spacing.
There are no line breaks in the paragraph. The settings are shown below.
I have attached a small project.
It happens at other time...
link: ago :oops:
https://www.b4x.com/android/forum/threads/b4x-bbcodeview-line-spacing-problem-related-to...
B4J Tutorial [B2X]Documention of BBCode Variant of BBCodeView Using BBCodeView Itself - William Lancee    
May 31, 2023   
(5 reactions)The recent addition of the anchor tag in BBCodeView opens up an efficient and effective way for creating documentation that works on a desktop and devices.
This tag allows you to scroll to any section of a (possibly lengthy) scrollable BBCodeView.
BBCodeView has grown with leaps and bounds over the years. I decided to document all current features.
As an exercise, I decided to implement the documentation in a BBCodeView, making it pleasingly self-referential.
142492
142493
The attached...
B4J Question BBCodeView crashes in Debug, works fine in Release - Sandman    
May 4, 2022I have a project in B4J that contains a layout with a BBCodeView. I wanted that layout in another... to connect...
Program started.
Error occurred on line: 61 (BBCodeView)
java.lang.RuntimeException... I remove the BBCodeView from the layout everything works. I've then tried doing a new copy/paste of just that, but that didn't help. I've also tried simply deleting the BBCodeView and...(B4XViewWrapper.java:121)
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java...
B4A Code Snippet [B4X]Index ScrollTo Heights in BBCodeView - Marked Sections & Words Occurrences - William Lancee    
May 3, 2023   
(8 reactions)
Private Root As B4XView
Private xui As XUI
Private BBCodeView1 As BBCodeView
Private...)
BBCodeView1.TextEngine = TextEngine1
Dim margin As Int = 25dip
Dim margins As B4XRect: margins.Initialize(margin, margin, margin, margin)
BBCodeView1.Padding = margins
BBCodeView1.mBase.Visible = False
Dim markTime As Long = DateTime.now
BBCVClr = IntToHex(BBCodeView1.mBase.Color)
BBCodeView1.Text = getBBCVText 'although not visible this creates all...
B4J Question BBCodeView - selected part - LucaMs    
Oct 12, 2025The answer will almost certainly be "o," but I'll try anyway.
Is it possible to get the user-selected part of a BBCodeView?
I assume not, that it's a BBCodeViewer, and in fact in the example it's not possible to select parts at all.
I haven't looked at the source code;...
link: BCTextEngine doesn't support text selection. The best you can do is to provide a "copy all text" or a similar option....
link: Never mind, I'll solve the "problem" differently....
Bug? [B4X][BBCodeview] Line spacing problem related to font size. - William Lancee    
Dec 28, 2021When the textsize is greater then 35, the line spacing is inconsistent
123541
BBCodeView1.Text = _
$"
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc fermentum elit vitae nisi faucibus, vitae lacinia turpis mattis.
"$...
Page: 1  
2  
3  
4  
5  
6  
7