Xamarin形成透明度和自定义控件

时间:2018-12-01 06:44:50

标签: wpf xamarin

我正在开发一个跨平台的游戏板(WPF和Android)。 我在scrollView布局中有一个网格,并且在每个单元格中给它充气 单元格自定义控件

df1

问题在于,Android中的控件不像WPF中那样透明。

请参阅:

WPF

WPF

Android

Android

1 个答案:

答案 0 :(得分:1)

尝试为Transparent使用Frame背景色:

<ContentView.Content>
 <Frame x:Name ="fr" BackgroundColor="Transparent" BorderColor="Black" Padding="0">
  <Grid HorizontalOptions="FillAndExpand" >
    <Grid.RowDefinitions>
      <RowDefinition Height="*"/>
         </Grid.RowDefinitions>
           <Label Grid.Row="0" x:Name="txt"/>
           <Image Grid.Row="0" x:Name="img"/>
         </Grid>
  </Frame>
</ContentView.Content>
相关问题