如何将表格背景设置为便携式跨平台Xamarin表格的透明度?

问题描述:

我正在使用便携式xamarin跨平台.我有两个项目android和IOS.

I am using Portable xamarin cross platform. I have two project android and IOS.

我必须使表格成为透明表格.我已经编写了相同的代码,并且此代码可以在android中完美运行,但不能在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

下面是我的代码:

  <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>

以下是android屏幕截图:

下面是IOS ScreenShot:

请建议我该怎么做才能在两个平台上都具有透明性表格

Please suggest me what to do to have transparency form in both platform

预先感谢

更简单的解决方案是只更改alpha通道的十六进制值.

Even simpler solution would be to just change the hex values of the alpha channel.

所以只需执行#FBC1BC>#50FBC1BC

您将获得透明的背景颜色,其中alpha值由前两个值定义!

And you will get a transparent background color with alpha defined by the first two values!