What I am needing is when the user clicks on the CustomListView/Spinner(Not sure what it will be) it will open a customlistview/Spinner and allow the user to edit text in an edittextbox. Currently it looks like the first picture. But it needs to look like the second. I've uploaded a customlistview project that looks like the second picture. Any help will be appreciated.
add these to Main Activity to handle the click event ..
B4X:
Sub clv2_ItemClick (Index As Int,Value As Object)
Log(Index & " = " & Value)
End Sub
Sub Button1_Click
Log ("You have Clicked Me")
End Sub
A simple solution to your other problem might be ...
in Click event call sub to display panel containing spinner / edittext to edit team names then update the CLV...
Afterthought .. Do you really need a button in the layout ? .. If not , Do you really need the layout. load the label in code.
The CLV itself NOW handles the ClickEvent ...
B4X:
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.Black
Dim lbl As Label
lbl.Initialize("")
lbl.Text = Text
lbl.TextSize = clv2.DefaultTextSize 'or whatever
p.AddView(lbl, 20dip, 10dip, 140dip,60dip)
Return p
End Sub
a bit extra for you ...
B4X:
Sub clv2_ItemClick (Index As Int,Value As Object)
Dim pnl As Panel
pnl = clv2.GetPanel(Index)
Dim lbl As Label
lbl = pnl.GetView(0) '0 becuause Label 1st Item added to panel
lbl.Text = "New Text"
End Sub
I was wondering what you were talking about when you mentioned a button. But as I was thinking about it there would be no way for the user to tell the app when they were finished editing. So now I am thinking leaving it as a spinner and when they click each team name open up a input box and let them edit the names that way. What do you think?
I was wondering what you were talking about when you mentioned a button. But as I was thinking about it there would be no way for the user to tell the app when they were finished editing. So now I am thinking leaving it as a spinner and when they click each team name open up a input box and let them edit the names that way. What do you think?
I was wondering what you were talking about when you mentioned a button. But as I was thinking about it there would be no way for the user to tell the app when they were finished editing. So now I am thinking leaving it as a spinner and when they click each team name open up a input box and let them edit the names that way. What do you think?
Hey Mango. I like what you did. Now can you tell me how when the user clicks on the edt it clears the existing text? Also on my current project in the designer I click on add view and Customview is greyed out.
I'm slightly confused ... Are you planning to use CLV now ? ... Have you added CustomListView class to your project.
If Not , that will explain why .. Designer Menu > Add View > Custom View is greyed out.
It might be easier to upload current project or example.