In normal button creation on BBCodeview based on Erel these steps are needed:
Step 1:
Dim btnb As Button
btnb.Initialize ("btnb")
btnb.Text = "View Answer"
btnb.SetLayoutAnimated(0, 0, 0, 100dip, 80dip)
Step 2: follow by this: BBCodeView1.Views.Put("btnb", btnb)
Step 3: place button view where you need it thus: [View=btnb vertical = 10 /]
In this context, i am trying to make 3-buttons beside view button in loop at the right hand-side as shown in demo picture below and use sender to get each button id, but [View=btnb vertical = 10 /] is not working. Please, what should i have done differently?
I want button to display at the right-hand-side of each View Result link instead
Here is the attached source code
Step 1:
Dim btnb As Button
btnb.Initialize ("btnb")
btnb.Text = "View Answer"
btnb.SetLayoutAnimated(0, 0, 0, 100dip, 80dip)
Step 2: follow by this: BBCodeView1.Views.Put("btnb", btnb)
Step 3: place button view where you need it thus: [View=btnb vertical = 10 /]
In this context, i am trying to make 3-buttons beside view button in loop at the right hand-side as shown in demo picture below and use sender to get each button id, but [View=btnb vertical = 10 /] is not working. Please, what should i have done differently?
I want button to display at the right-hand-side of each View Result link instead
Here is the attached source code
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private BBCodeView1 As BBCodeView
Private TextEngine As BCTextEngine
Public name, country, status As String
Private Spinner1 As Spinner
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("bblooptest2")
TextEngine.Initialize(Activity)
'BBCodeView1.TextEngine.WordBoundaries = "&*+-/<>=\{}" & TAB & CRLF & Chr(13)
BBCodeView1.TextEngine.WordBoundariesThatCanConnectToPrevWord = $"'.,":?;!"$
BBCodeView1.sv.ScrollViewOffsetY = 0
Dim btnb As Button
btnb.Initialize ("btnb")
btnb.Text = "View Answer"
btnb.SetLayoutAnimated(0, 0, 0, 100dip, 80dip)
BBCodeView1.Views.Put("btnb", btnb)
'[View=btnb vertical = 10 /]
Dim str As String
For i = 0 To 2
name = "University of Lagos"
country = "Increased agricultural marketing and farming" ' user_map.Get("country")
status = "Inventory management system" ' user_map.Get("status")
Spinner1.Add(name)
str= str & $"${CRLF}${CRLF}${name}${CRLF}${country}${CRLF}${status}${CRLF}[url = "https://www.google.com"]View Result [/url][Alignment=right]View=${btnb}[/Alignment]"$
Next
BBCodeView1.Text = $"[Color=#ff0000][TextSize=17][Alignment=left][b]${str}[/b][/Alignment][/TextSize][/Color]${CRLF}"$ & ""
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub