Xamarin.CommunityToolkit Popup Android and IOS Padding problem

Stefan Bauerfeindt 96 Reputation points
2021-06-29T08:27:02.01+00:00

Dear all,

i write a simple popup menu with Xamarin.CommunityToolkit on left site the text without Padding works fine... but on IOS i want disable the border, can anyone help to solve this problem

<?xml version="1.0" encoding="utf-8" ?>
<xct:Popup xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:xct="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TestPage">
<xct:Popup.Content>
<StackLayout>
<Label Text="Hello Content Popup Page"></Label>
</StackLayout>
</xct:Popup.Content>
</xct:Popup>

thank you for help :-)

kind regards

stefan

110201-xct-popup-bug.jpg

110156-xct-popup-bug-2.jpg

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,377 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stefan Bauerfeindt 96 Reputation points
    2021-07-02T10:41:27.117+00:00

    Dear Leon,

    sorry for delaying, i was sick.

    thanks for your answer, i found a pretty simple solution to solve my problem:

    <?xml version="1.0" encoding="utf-8" ?>
    <xct:Popup xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:xct="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="TestPage">
    <xct:Popup.Content>
    <StackLayout Padding="{OnPlatform iOS=-27, Android=0}">
    <Label Text="Hello Content Popup Page"></Label>
    </StackLayout>
    </xct:Popup.Content>
    </xct:Popup>

    111383-xct-popup-solution.jpg

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 79,701 Reputation points Microsoft Vendor
    2021-06-30T05:59:57.773+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    I find a similar issue in Xamarin.CommunityToolkit GitHub. It set trans parent backgrounds to achieve it, but for iOS, it do not achieve it like following screenshot.

    https://github.com/xamarin/XamarinCommunityToolkit/issues/1097#issuecomment-803399516

    110511-image.png

    Here is another ways to achieve it, you can use Rg.Plugins.Popup

    Here is my test running screenshot with Rg.Plugins.Popup.

    110410-image.png

    About how to use it, you can refer to this wiki

    https://github.com/rotorgames/Rg.Plugins.Popup/wiki

    Best Regards,

    Leon Lu


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Alex Chuchko 1 Reputation point
    2022-07-12T20:56:15.043+00:00

    220000-image.png

    Hello! Fulfilled your recommendations, but now the CollectionView at a height of 27 does not work. Please tell me how to fix this problem!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.