Bug with ListView item background color on certain Android versions

0 Answers 83 Views
Top achievements
Rank 1
almostEric asked on 24 May 2023, 02:51 PM

I have a listview using templatecells.

With android API >= 31, everything looks fine (default background is transparent)

On androd API 28, the background defaults to white, you can manually set it to other colors which work, but if set to transparent, the background stays white

Telerik team
commented on 26 May 2023, 10:21 AM

Hello Erin,

Could you please provide more details about where you set the BackgroundColor property? On the element inside the template cell, on the RadListView, or using the ItemStyle?  Could you provide a code snippet of how you defined the ListView in XAML?

Top achievements
Rank 1
commented on 21 Oct 2023, 11:05 PM

I am running into this as well, below is code for my listview, everything is listening to the color transparency except Each Listview item.

<telerik:TabViewItem ImageSource="messagecenter_received_on" >
    <telerik:RadListView ItemsSource="{Binding ReceivedItems}" BackgroundColor="Transparent">
            <DataTemplate x:DataType="local:Gift">
                        <Grid ColumnDefinitions="100,*,50" RowDefinitions="40,50*" BackgroundColor="Transparent">
                            <Border Grid.RowSpan="2" Stroke="{StaticResource Gray100}" HorizontalOptions="Start" VerticalOptions="Center" StrokeThickness="4" WidthRequest="80" HeightRequest="80" StrokeShape="RoundRectangle 40">
                                    <Shadow Brush="Black" Offset="2,2"></Shadow>
                                <Image Source="{Binding SenderImage}" WidthRequest="100" HeightRequest="100" Aspect="AspectFill" HorizontalOptions="Center" VerticalOptions="Center"></Image>
                            <Label Text="{Binding SenderUsername}" Grid.Column="1" FontSize="Large" VerticalOptions="End" />
                            <Label Text="{Binding createdAt}" Grid.Column="1" FontSize="Micro" Grid.Row="2" VerticalOptions="Start" />


Telerik team
commented on 24 Oct 2023, 12:38 PM

Hi Robert,

You would need to set the BackgroundColor through the ItemStyle property of the ListView like this:


<telerik:RadListView ItemsSource="{Binding ReceivedItems}" BackgroundColor="Transparent">
        <telerik:ListViewItemStyle BackgroundColor="Transparent" />


Please give this a try and let me know if you still experience any issues.

No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 1
Share this question