This is a migrated thread and some comments may be shown as answers.

BackgroundColor="Transparent" not working on IOS

1 Answer 662 Views
ListView - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 13 Nov 2019, 04:48 PM

Hi,

Is it possible to have a transparent background on IOS?

I tried setting BackgroundColor="Transparent" and it works fine on Android but not on IOS.

Please help.

 

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 13 Nov 2019, 08:11 PM

Hello Michael,

You can achieve your goal by using the RadListView ItemStyle.

Here's an example:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:dataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
             xmlns:listView="clr-namespace:Telerik.XamarinForms.DataControls.ListView;assembly=Telerik.XamarinForms.DataControls"
             mc:Ignorable="d"
             x:Class="App73.MainPage"
             x:Name="Page"
          BackgroundColor="DarkCyan">

    <Grid x:Name="RootGrid">
        <dataControls:RadListView x:Name="MyListView" BackgroundColor="Transparent">
            <dataControls:RadListView.ItemStyle>
                <listView:ListViewItemStyle BackgroundColor="Transparent"/>
            </dataControls:RadListView.ItemStyle>
            <dataControls:RadListView.ItemTemplate>
                <DataTemplate>
                    <listView:ListViewTemplateCell>
                        <Label Text="{Binding}" TextColor="LightCyan"/>
                    </listView:ListViewTemplateCell>
                </DataTemplate>
            </dataControls:RadListView.ItemTemplate>
        </dataControls:RadListView>
    </Grid>
</ContentPage>

Notice the page background is set to DarkCyan and the ItemStyle is set to Transparent background.

Here's the result at runtime:


Regards,
Lance | Team Lead - US DevTools Support
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView - Xamarin.iOS
Asked by
Michael
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or