Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Width and Height for Modal in Xamarin.Forms

$
0
0

From one of the pages of my app im calling another page in a modal.

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage 
    xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    x:Class="SIMA.Core.Views.Modals.AboutModalPage">

    <ContentPage.Content>
        <Label Text="About Modal Window" />
    </ContentPage.Content>
</ContentPage>

That's the page that i call in the modal (AboutModalPage.xaml).

And im calling it from another page with this:

            LabelHeader.GestureRecognizers.Add(new TapGestureRecognizer {
                Command = new Command ( () => {


                    Page modal = new AboutModalPage();
                    modal.WidthRequest = 300;

                    Navigation.PushModalAsync(modal);

                }),
                NumberOfTapsRequired = 1
            });

It works, but i want that the modal employ only part of the screen, not full screen, like a tipical modal window.
How can i achieve that?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>