iOS Question Table Calendar

tcgoh

Active Member
Licensed User
Hi,

I am trying to create a table with the left column as date.
Attached are the pic the project zip file.

But I am unable to change the text color to RED for Sunday. Even if i try to insert this
B4X:
Private Sub ShowRow(row As Int)
    If visibleRows.ContainsKey(row) Then Return
    Dim lbls() As Label
    Dim values() As String
    lbls = GetLabels(row)
    values = Data.Get(row)
    visibleRows.Put(row, lbls)
    Dim rowColor As Int
    If row = SelectedRow Then
        rowColor = SelectedRowColor
    Else If row Mod 2 = 0 Then
        rowColor = EvenRowColor
    Else
        rowColor = OddRowColor
    End If
    For I = 0 To lbls.Length - 1
        SV.Panel.AddView(lbls(I), Header.GetView(I).Left, row * RowHeight, Header.GetView(I).Width, _
            RowHeight - 1dip)
        lbls(I).Text = values(I)
        lbls(I).Color = rowColor
        lbls(I).Font = Font.DEFAULT_BOLD
       
        If lbls(0).Text.Contains("Sun") Then   ' change color of text if sunday
            lbls(0).TextColor = Colors.Red
        End If
    Next
End Sub
to the class module. This code will not work after you re-start the program.

Anyone have any idea ?

Thanks
 

Attachments

tcgoh

Active Member
Licensed User
@Erel
I tried with the code you provided. But I'm getting this error msg!
(in B4A its works with this code)error.JPG

Thanks
 
Top