I am using Portable xamarin cross platform. I have two project android and IOS.
I have to make form as transparent form. I have written code for same and this code perfectly working in android but not in IOS
Below is my code:
<ContentPage BackgroundColor="#00000000">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="180"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="200"></RowDefinition>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" VerticalOptions="StartAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="#80000000" HeightRequest="175" >
</StackLayout>
<BoxView HeightRequest="200" Grid.Row="1"></BoxView>
<StackLayout VerticalOptions="End" HorizontalOptions="FillAndExpand" BackgroundColor="#80000000" HeightRequest="160" Grid.Row="2" >
<Label Text="05:00" FontSize="60" FontAttributes="Bold" TextColor="White" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" ></Label>
</StackLayout>
</Grid>
</ContentPage>
Below is android Screen shot:
Below is IOS ScreenShot :
Please suggest me what to do to have transparency form in both platform
Thanks in advance
Even simpler solution would be to just change the hex values of the alpha channel.
So just do this #FBC1BC > #50FBC1BC
And you will get a transparent background color with alpha defined by the first two values!
BackgroundColor = Color.Transparent
OR in xaml
`<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XXX.Core.Views.Pages.XXXX.XXXX"
xmlns:local="clr-namespace:XXX.Core.Views.CustomControls"
BackgroundColor="Transparent">`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With