iOS Question Table Calendar

tcgoh

Active Member
Licensed User
Longtime 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

  • IMG_8967.PNG
    IMG_8967.PNG
    28.2 KB · Views: 266
  • img date.PNG
    img date.PNG
    28.7 KB · Views: 254
  • tabledate.zip
    11.6 KB · Views: 267

tcgoh

Active Member
Licensed User
Longtime 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
 
Upvote 0
Top