iOS Question Setting runtime text on Navigation bar

tcgoh

Active Member
Licensed User
Longtime User
Is its possible to set the toprightbutton text on runtime

eg.
page1.TopRightButtons.Add("KKK")
or
page1.TopRightButtons.Add(edittext1.text)
 

stevel05

Expert
Licensed User
Longtime User
You'll need to replace a button in the returned list, then assign the list to the TopRightButtons.
 
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,
this doesn't works for me:
B4X:
Sub ReplaceBarButtonText(Tag As String, NewText As String)
  Dim buttons As List = Page1.TopRightButtons
  For i = 0 To buttons.Size - 1
  Dim bb As BarButton = buttons.Get(i)
  If bb.Tag = Tag Then
  Dim newButton As BarButton
  newButton.InitializeText(NewText, Tag)
  buttons.Set(i, newButton)
  Exit
  End If
  Next
  Page1.TopRightButtons = buttons
End Sub
Any idea?
 
Last edited:
Upvote 0
Top