How to apply css styles to TextCell and change TextColor

660 Views Asked by At

I want to change the TextColor of a TextCell in a ListView with CSS styles.

I tried the following, but the color remains unchanged:

MenuPage TextCell {
    color: aqua;
    textcolor: aqua;
    text-color: aqua;
    TextColor: aqua;
}
1

There are 1 best solutions below

0
user2703437 On BEST ANSWER

I've had no luck with TextCell. But if you can make it a Label in a ViewCell:

<ListView.ItemTemplate>
    <DataTemplate>
        <ViewCell>
            <StackLayout>
                <Label Text="{Binding}" />
            </StackLayout>
        </ViewCell>
    </DataTemplate>
</ListView.ItemTemplate>

then you can style it with CSS:

ListView StackLayout Label {
    font-size: 14;
    color: black;
}