Xamarin Forms view stretches out of screen for some display densities of tablet devices

Shubham Kumar 1 Reputation point
2021-07-13T11:09:54.277+00:00

Xamarin Forms views get stretched on some android tablet devices/emulators with different screen densities. It is impossible to use the lower portion of the UI since it is not visible due to this stretching issue. One of the emulators being used has the following configuration:

Resolution: 1366 * 768

Screen Density: 213

Any suggestions/ideas on why is it occurring and how to handle it?

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

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,951 Reputation points
    2021-07-14T03:02:29.303+00:00

    Hello @Shubham Kumar ,​

    Welcome to our Microsoft Q&A platform!

    The view may show different effects on devices of different sizes. For example, an image with a fixed width is displayed well on a mobile phone, but may be very small on a tablet.

    To fix this, you could specify different size for the views on phone and tablet. The Device.Idiom property can be used to alter layouts or functionality depending on the device the application is running on.
    Check the doc: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/device#deviceidiom

    And you could create a resourceDictionary to the customize the device resolutions. For more details, please check: https://devblogs.microsoft.com/xamarin/styling-for-multiple-device-resolutions/

    Best Regards,

    Jarvan Zhang


    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.