gpt4 book ai didi

xamarin - 在 Xamarin.Forms 中,如何使用 RG.Plugin 在所需位置设置弹出页面?

转载 作者:行者123 更新时间:2023-12-02 20:01:44 27 4
gpt4 key购买 nike

我安装了 Nuget 包 Rg.plugins.popup。尝试设置一个应显示在右侧的弹出页面。尝试了不同的方法但未能找到解决方案

<pages:PopupPage.Animation>

<animations:MoveAnimation
PositionIn="Right"
PositionOut="Right"
DurationIn="300"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"
HasBackgroundAnimation="True"/>

</pages:PopupPage.Animation>

有RG插件的解决方案吗?

最佳答案

这与动画无关,仅控制外观。您应该确保弹出页面的内容排列正确。例如,下面是弹出页面的 XAML,它将在右上角显示一个方形弹出窗口。

<?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="MyApp.Views.RandomPopupPage">
<StackLayout
BackgroundColor="White"
HorizontalOptions="End"
VerticalOptions="Start"
Margin="20"
WidthRequest="100"
HeightRequest="100"
Spacing="0">
<Label
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
VerticalOptions="Center"
HorizontalOptions="Center"
Text="Some text here" />
</StackLayout>
</pages:PopupPage>

它有一个 StackLayout,与开始(顶部)垂直对齐,与结束(右侧)水平对齐。它也有固定的宽度和高度。您应该像处理普通页面一样排列其元素,并记住它具有透明背景。

看起来像这样:See image

关于xamarin - 在 Xamarin.Forms 中,如何使用 RG.Plugin 在所需位置设置弹出页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55714966/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com