German Jede zweit Zeile färben

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hallo,

habe mir scrollview zeilen geschrieben, und möchte jede zweite Zeile färben,

als Ansatz verwende ich dieses
B4X:
Panel1.Color=Colors.White
Panel1.Color=Colors.RGB(235,235,235)

aber es soll mit weis beginnen
gruß
sinan
 

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hi Klaus,

B4X:
FillScrollView(Spalte(0),Spalte(0),Spalte(2),Spalte(4), Spalte(5))

B4X:
Sub FillScrollView(resim As String, Handynummer As String,msg As String, ok As String, datum As String)
      
   Panel0=scvMain.Panel
   Panel0.Color=Colors.RGB(235,235,235)
   
      Dim Panel1 As Panel
      
       Panel1.Initialize("View")
      Panel1.Tag=Handynummer
      
      PanelHeight=65dip
      
      Panel0.AddView(Panel1,0,PanelTop,scvMain.Width,PanelHeight)
      
      Panel1.Color=Colors.White
      'Panel1.Color=Colors.RGB(235,235,235)
      
      
      Dim Label1 As Label
      Label1.Initialize("View")
      Panel1.AddView(Label1,70dip,5dip,200dip,30dip)
      Label1.TextSize=18
      Label1.Typeface = Typeface.DEFAULT_BOLD
      Label1.Tag=index
      Label1.Text=msg
      Label1.TextColor=Colors.Black
      PanelTop=PanelTop+PanelHeight+1dip
       
      If PanelTop < 100%y Then
         Panel0.Height = 100%y 
         Else If PanelTop > 100%y Then
         Panel0.Height= PanelTop
      End If
   

End Sub
 

Dataverde

Member
Licensed User
Longtime User
Alternativ:
B4X:
'dim colorChanger as boolean = true

if colorChanger then
Panel1.Color=Colors.White
Else
Panel1.Color=Colors.RGB(235,235,235)
end if
colorChanger = not(colorChanger)
 
Top