Kir*_*are 10 android xamarin.ios ios
我正在使用便携式 xamarin 跨平台。我有两个项目 android 和 IOS。
我必须把表格做成透明的形式。我已经为相同的代码编写了代码,这段代码在 android 中完美运行,但在 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>
Run Code Online (Sandbox Code Playgroud)
下面是安卓截图:
以下是IOS截图:
请建议我如何在两个平台上都有透明度表格
提前致谢
小智 12
更简单的解决方案是仅更改 alpha 通道的十六进制值。
所以就这样做#FBC1BC > #50FBC1BC
您将获得一个透明的背景颜色,其 alpha 由前两个值定义!
只需在 stacklayout 中包含 opacity 属性:
<StackLayout VerticalOptions="End" HorizontalOptions="FillAndExpand" BackgroundColor="#80000000" Opacity="0.5" HeightRequest="160" Grid.Row="2" >
<Label Text="05:00" FontSize="60" FontAttributes="Bold" TextColor="White" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" ></Label>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19658 次 |
| 最近记录: |