我写了下面的xaml,但是我在android上有一个问题。Frame控件覆盖了Label的颜色,我不知道为什么。当我用网格替换一个框架时,工作完美,但我想要的框架的角落半径。
这是个窃听器?我能修好它吗?
<Grid x:Name="Frame_6_10">
<Frame WidthRequest="30" BackgroundColor="#55b040" IsClippedToBounds="true" CornerRadius="10"/>
<Label Margin="0,7,0,0" Text="6-10" TextColor="White" FontSize="16" HorizontalOptions="Center"
VerticalOptions="Center" HorizontalTextAlignment="Center" FontAttributes="Bold"/>
<ContentView HeightRequest="7" VerticalOptions="Start" WidthRequest="30" BackgroundColor="#55b040"/>
</Grid>
我使用Xamarin Forms版本3.1.0.697729
发布于 2019-01-10 21:05:09
从你的代码来看,我认为是内容视图覆盖了标签。试着删除它,看看会发生什么。
发布于 2019-01-14 14:11:58
把你的contentView放进你的框架里
<Grid x:Name="Frame_6_10">
<Frame WidthRequest="30" BackgroundColor="#55b040" IsClippedToBounds="true"
CornerRadius="10">
<ContentView HeightRequest="7" VerticalOptions="Start"
WidthRequest="30" BackgroundColor="#55b040">
<Label Margin="0,7,0,0" Text="6-10" TextColor="White"
FontSize="16" HorizontalOptions="Center"
VerticalOptions="Center" HorizontalTextAlignment="Center"
FontAttributes="Bold"/>
</ContentView>
</Frame>
</Grid>
https://stackoverflow.com/questions/54127723
复制相似问题