Δύναμη Διός, κάπου στον κώδικα σου έχεις δηλώσει μάλλον dim p as phone. Άλλαξε το dim p as panel σε κάποιο άλλον όνομα π.χ. p2.
Αλεξανδρεια ... πως παει εκει ?
When I go to reference libraries, I found Core (version 2.26) and String Utils (version 1.02) are checked.Error description: Unknown type: reflector
Advantages of CustomListView:•Each item is made of a Panel that can hold any views.
Is it possible to design each panel in the designer?
I can't immediately see any way of loading a layout into the CustomListView.
It's just that adjusting positions of views on each panel in code is slow and tortuousa bit to the left, compile, nope, down a bit, compile, nope a bit to the right, compile nope ......
Yes. Create a panel and call Panel.LoadLayout.Is it possible to design each panel in the designer?
Public DefaultTextSize2 As Int
Public DefaultTextColor2 As Int
DefaultTextColor2 = Colors.Gray
DefaultTextSize2 = 16
Public Sub AddTextItem2(Text1 As String, Text2 As String, Value As Object)
InsertAtTextItem2(items.Size, Text1, Text2, Value)
End Sub
Public Sub InsertAtTextItem2(Index As Int, Text1 As String, Text2 As String, Value As Object)
Dim pnl As Panel
pnl.Initialize("")
Dim lbl1 As Label
lbl1.Initialize("")
lbl1.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl1.Text = Text1
lbl1.TextSize = DefaultTextSize
lbl1.TextColor = DefaultTextColor
Dim lbl2 As Label
lbl2.Initialize("")
lbl2.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl2.Text = Text2
lbl2.TextSize = DefaultTextSize2
lbl2.TextColor = DefaultTextColor2
pnl.Color = DefaultTextBackgroundColor
Dim minHeight As Int
pnl.AddView(lbl1, 5dip, 2dip, sv.Width - 5dip, 20dip)
minHeight = su.MeasureMultilineTextHeight(lbl1, Text1)
lbl1.Height = minHeight
pnl.AddView(lbl2, 5dip, minHeight + 2dip, sv.Width - 5dip, 20dip)
minHeight = su.MeasureMultilineTextHeight(lbl2, Text2)
lbl2.Height = minHeight
InsertAt(Index, pnl, lbl1.Height + lbl2.Height + 2dip, Value)
End Sub
Private Sub Panel_Touch (Action As Int, X As Float, Y As Float)
If Action <> 0 Then '0 => Activity.ACTION_DOWN
If SubExists(CallBack, EventName & "_ItemClick") Then
Dim v As View
v = Sender
CallSub3(CallBack, EventName & "_ItemClick", v.Tag, items.Get(v.Tag))
End If
End If
End Sub
[quote="Erel, post: 146278"]Yes. Create a panel and call Panel.LoadLayout.[/QUOTE]
Tried this and loaded layout under CreateListItem sub
Ex.
[CODE]Dim p As Panel
p.Initialize("")
p.LoadLayout("li") <<---Panel(listpnl) contains some labels and check boxes
Sub listpnl_LongClick
Dim index As Int
index = clv2.GetItemFromView(Sender)
Dim pnl As Panel
pnl = clv2.GetPanel(index)
Dim lbl As Label
Dim chk As CheckBox
lbl = pnl.GetView(0) <<--------------- Error (Object Should first be initialized(View))
chk = pnl.GetView(2)
lbl.Text = "Clicked!"
Msgbox("Item value: " & clv2.GetValue(index) & CRLF & "Check value: " & chk.Checked, "")
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?