首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Frame仅在安卓系统上覆盖标签TextColor (xamarin-forms)

Frame仅在安卓系统上覆盖标签TextColor (xamarin-forms)
EN

Stack Overflow用户
提问于 2019-01-10 19:28:06
回答 2查看 110关注 0票数 0

我写了下面的xaml,但是我在android上有一个问题。Frame控件覆盖了Label的颜色,我不知道为什么。当我用网格替换一个框架时,工作完美,但我想要的框架的角落半径。

这是个窃听器?我能修好它吗?

代码语言:javascript
运行
复制
             <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

EN

回答 2

Stack Overflow用户

发布于 2019-01-10 21:05:09

从你的代码来看,我认为是内容视图覆盖了标签。试着删除它,看看会发生什么。

票数 0
EN

Stack Overflow用户

发布于 2019-01-14 14:11:58

把你的contentView放进你的框架里

代码语言:javascript
运行
复制
    <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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54127723

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档