Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Spec] Popup add margin property #1398

Open
Cfun1 opened this issue Jun 15, 2021 · 3 comments
Open

[Spec] Popup add margin property #1398

Cfun1 opened this issue Jun 15, 2021 · 3 comments
Labels
a/popup feature-request A request for a new feature.

Comments

@Cfun1
Copy link
Contributor

Cfun1 commented Jun 15, 2021

[The feature]

Started in this question/discussion #1188, it is intended to give the dev the ability to set margin for popup and thus giving more flexibility over popup position adjustment (in addition to VerticalOptions and VerticalOptions properties).

API

[ BasePopup.shared.cs]

Properties

API Type Description
Margin Thickness Gets or sets the margins of the popup.

Scenarios

Let say you have a popup and want to position it in the bottom center with a slight vertical margin (space between bottom edge of the screen and the bottom edge of the popup), you will put:

<xct:Popup ...
             VerticalOptions="FillAndExpand"
             HorizontalOptions="FillAndExpand"
             Margin="0,0,0,40"
...

Platform Compatibility

  • Target Frameworks:
    • iOS:
    • Android:
    • UWP:

Backward Compatibility

Difficulty : [low/medium/high]

@Cfun1 Cfun1 added the feature-request A request for a new feature. label Jun 15, 2021
@SkyeHoefling
Copy link
Contributor

Thanks for writing up this specification, I think this is the direction that we want to go. I think we should make the following adjustments to this specification.

Margin can be set only if the following conditions are met

VerticalOptions = FillAndExpand
HorizontalOptions = FillAndExpand

With those properties set we can check in the renderer and then force the popup to take up all the bounds on the screen. Then you could use the Margin property to set the space between the edge of the popup and the edge of the screen.

@Cfun1
Copy link
Contributor Author

Cfun1 commented Jun 16, 2021

@ahoefling I have updated the spec accordingly, so setting VerticalOptions and HorizontalOptions to FillAndExpand does not necessarily mean that the popup content will take the whole space (after the enhacement), it also depends on it content more specifically the root view, right?

@SkyeHoefling
Copy link
Contributor

hmm 🤔🤔

We should consider the Size as well because if someone sets size, should we disregard VerticalOptions? and HorizontalOptions? Or if the VerticalOptions and HorizontalOptions are set to FillAndExpand should we disregard the size and make it full screen to start applying the margin.

This is going to merit more discussion to get the rules right in the specification

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/popup feature-request A request for a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants