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

Get View Height and Weight

$
0
0

I'm trying to do a layout based on screen resolution. This way I can use it in all screes resolutions.
For it I'm taking the screen resolution of device.
However it returns resolution of all the screen with actions bar, tabs and etc.

I would like to get only the Content page "usable" Height and Widht.

I tried some Approaches:

*First created a stack layout and setted to Fill and Expand to take all the screen.
After asked for his height but returned -1.

*After I tried do get the height of the page.
Like this:

        public class TestPage : ContentPage
            {
                public TestPage ()
                {
                    var dim = this;
                    var height = dim.Height;
                        }
                }

But it also returned -1.

There are any way to get the dimensions of the stack layout or page.... or even the screen without the action bar? (For screen I already get)


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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