May 24, 2023 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: Code: For Each pol As Politician In politicians sb.Append($" [a="${pol.Name}"][b][TextSize=18]${pol.Name}[/TextSize][/b][/a] Twitter: [url]@${pol.TwitterUserName}[/url] Birthday: $Date{pol.Birthday} ${pol.Party} "$) Next Note the "a" tag at the beginning. The anchors are used in this code: Code: Private Sub btnJumpTo_Click Wait For (dialog.ShowTemplate(SearchTemplate, "", "", "Cancel")) Complete (result As Int) If result = xui.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 this with a larger dataset. Attachments Anchors2.zip Anchors2.zip 449.9 KB · Views: 818 Last edited: May 24, 2023 Click to expand...
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: Code: For Each pol As Politician In politicians sb.Append($" [a="${pol.Name}"][b][TextSize=18]${pol.Name}[/TextSize][/b][/a] Twitter: [url]@${pol.TwitterUserName}[/url] Birthday: $Date{pol.Birthday} ${pol.Party} "$) Next Note the "a" tag at the beginning. The anchors are used in this code: Code: Private Sub btnJumpTo_Click Wait For (dialog.ShowTemplate(SearchTemplate, "", "", "Cancel")) Complete (result As Int) If result = xui.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 this with a larger dataset.