locked
Unit of bounds Property in Inspector RRS feed

  • Question

  • User365503 posted

    Are the Bounds values measured in pixels or in the same fashion as Xaml? The Inspector doesn't specify. Should I have to use the scale factor of the device to get the precise number of pixels?

    Thursday, July 19, 2018 5:23 PM

Answers

  • User73391 posted

    Assuming this is a Xamarin.Forms app, the Bounds for any element are in device-independent units.

    https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.visualelement.bounds?view=xamarin-forms https://docs.microsoft.com/en-us/xamarin/xamarin-forms/creating-mobile-apps-xamarin-forms/summaries/chapter05

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, July 19, 2018 5:34 PM

All replies

  • User73391 posted

    Assuming this is a Xamarin.Forms app, the Bounds for any element are in device-independent units.

    https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.visualelement.bounds?view=xamarin-forms https://docs.microsoft.com/en-us/xamarin/xamarin-forms/creating-mobile-apps-xamarin-forms/summaries/chapter05

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, July 19, 2018 5:34 PM
  • User365503 posted

    So 100 in Xaml would be 100dp in Android and 100 points in iOS right?

    Monday, July 23, 2018 5:13 PM
  • User73391 posted

    I believe so, but I'm not that familiar with Forms.

    Monday, July 23, 2018 5:16 PM
  • User365503 posted

    Ah okay. I'll play around with it. I was just being lazy and wanted to ask anyways. Thanks!

    Monday, July 23, 2018 5:53 PM