【问题标题】:Xamarin Forms Frame not rounding corners in iOSXamarin Forms Frame在iOS中没有圆角
【发布时间】:2020-07-23 19:23:24
【问题描述】:

我在这里遗漏了什么吗? iOS 根本不会绕过这个框架的角落吗?它在 Android 中运行良好。

<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage 
        xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
        xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
        x:Class="MyProject.MyPopup">
    <pages:PopupPage.Animation>
        <animations:ScaleAnimation 
            PositionIn="Center"
            PositionOut="Center"
            ScaleIn="1.2"
            ScaleOut="0.8"
            DurationIn="400"
            DurationOut="300"
            EasingIn="SinOut"
            EasingOut="SinIn"
            HasBackgroundAnimation="True"/>
    </pages:PopupPage.Animation>
    <Frame x:Name="ButtonMenuWrapper"                         
           HasShadow="False" 
           BackgroundColor="White"
           IsClippedToBounds="True" 
           CornerRadius="20" 
           Padding="0" 
           HorizontalOptions="Center" 
           VerticalOptions="Center">
        <StackLayout x:Name="ButtonMenu" 
                     Orientation="Vertical" 
                     Spacing="30" 
                     HorizontalOptions="Center" 
                     BackgroundColor="White" 
                     VerticalOptions="Center" 
                     Padding="20,20,20,20">
            <Button x:Name="Button1" 
                                WidthRequest="150" 
                                Text="Option 1" 
                                Clicked="Button1_Clicked"/>
            <Button x:Name="Button2" 
                                WidthRequest="150" 
                                Text="Option 2" 
                                Clicked="Button2_Clicked"/>
            <Button x:Name="Button3" 
                                WidthRequest="150" 
                                Text="Option 3" 
                                Clicked="Button3_Clicked"/>
        </StackLayout>
    </Frame>
</pages:PopupPage>    

由于某种原因,问题系统不允许我在没有更多所谓的详细信息的情况下提交此内容。我不知道还能说什么。此代码在 Android 中可以找到,但在 iOS 中,名为 ButtonMenuWrapper 的框架的角将不会根据其 CornerRadius 属性围绕称为 ButtonMenu 的 StackLayout 进行舍入。如果我没有充分解释问题,请在惩罚我和禁用问题之前要求具体说明。

【问题讨论】:

    标签: xamarin xamarin.forms xamarin.ios


    【解决方案1】:

    我用你的代码进行了测试,它在 iOS 上运行良好。


    版本信息

    视觉工作室:16.6.4

    Xamairn.Forms:4.6.0.847

    Rg.Plugins.Popup : 2.0.0.3

    【讨论】:

    • 我在 16.6.1 和 4.6.0.967 上,这不应该有所作为,如果我的不像棋盘那么方正,那就该死了。 ???
    • 如果可能,您能否提供一个可以重现该问题的基本示例项目?您可以上传到 github 并在此处附上链接。
    猜你喜欢
    • 2020-01-07
    • 2021-04-23
    • 2017-05-02
    • 2019-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-04
    • 1970-01-01
    相关资源
    最近更新 更多