角落在iOS、Xamarin表单的SwipeView中仍然可见

nhjlsmyf  于 2022-12-07  发布在  iOS
关注(0)|答案(1)|浏览(112)

当我使用SwipeView时,我仍然会显示边角。它在Xamarin.Android下不会这样做,只是只有在Xamarin.iOs下才会这样

下面是代码:

<SwipeView BackgroundColor="Transparent">
    <SwipeView.RightItems>
        <SwipeItems Mode="Reveal">

                    ***** Some code for the SwipeItems ****

        </SwipeItems>
    </SwipeView.RightItems>

    <Frame Margin="20" HeightRequest="65" BorderColor="CornflowerBlue"
           BackgroundColor="CadetBlue" CornerRadius="20">

                    ***** Some code *****
    </Frame>
</SwipeView>

有人知道为什么吗?谢谢

xe55xuns

xe55xuns1#

发生这种情况的原因是您已经为SwipeView指定了背景颜色,而BackgroundColor在不同平台上的处理方式有时会有所不同
所有你需要做的是,而不是设置为透明,设置为你的背景颜色应该是什么。

<SwipeView BackgroundColor="CadetBlue">

希望这对你有帮助

相关问题