Another option is set the style attribute of the listItem like this:
Use the Mod function to give you the remainder of a division. Dividing current row numbers by 2, you will always get a 0 or 1 because this function returns an integer.
Using this logic you can set your list item background.
Here an example (put this in the Attibutes property):
SyntaxEditor Code Snippet
If(Mod('yourlistname'.List.CurrentRowNumber,2)=1,"Background-color:red","Background-color:gray")
To follow the best practises, use CSS classes.
Regards.