question

ShubhamKumar-7254 avatar image
0 Votes"
ShubhamKumar-7254 asked JarvanZhang-MSFT edited

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

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?

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

Hello @ShubhamKumar-7254 ,​

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://docs.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.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @ShubhamKumar-7254
May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·