Forum Xamarin.Forms

How to work with differents kinds of resolution

GuiWaltrickeGuiWaltricke BRMember ✭✭

My app needs to work with Android(tablet and phone) and iOS(iPhone and iPad)...
I am testing on Android devices like Samsung S3, S4, S5, Nexus 4 and etc... but all of them have different resolutions and this is big problem.
Like my entry who is perfect in S5 but in the Nexus 4 is sooo large with the same width and height.
I tryed to calculate the width by using the density of each device, that get a little better on S3, but it is still awful.

What is the best way to do that?
I'm using Xamarin.Forms without XML, pure C#.

Thank you all.


  • jbravobrjbravobr BRMember ✭✭

    @Waltricke what really is the problem with the Entrycomponent? The width, heigth, scale ??

  • GuiWaltrickeGuiWaltricke BRMember ✭✭

    Hii jbravobr,

    the problem is that the entry is so large, like a scale...

    BR - Ele fica muito grande, muito mesmo, como tivesse com resolução baixa demais, um entry fica largo e etc..

  • stvansolanostvansolano UMInsider, University ✭✭✭

    Hello Guilherme,

    Have you tried Xamarin Player? I typically test with small and big screens and in some cases you need to re-adapt your XAML by making some layout tweaks to make it work.

    I would recommend you:

    1. Install emulator for both small and big screens.
    2. Inspect the current layout controls you are using and why they might be scaling so far (Grids, StackLayout, AbsoluteLayout, etc) if you are using Xamarin Forms.
    3. Make changes as necessary to your XAML to make it work on both small and big sizes.
    4. Test again
    5. If none of the above steps work for you, you could implement custom Android activities for targeting your specific sizes and use them accordingly.

    Let me know your results!

  • GuiWaltrickeGuiWaltricke BRMember ✭✭

    Hi @stvansolano

    My project is without XAML... everything is in code =(

    but i'll make this, another activity for small sizes.

    thank you

  • stvansolanostvansolano UMInsider, University ✭✭✭

    Good luke @Waltricke!

    Is your project Android only? Hope the designer can help you out to have it done :)

  • GuiWaltrickeGuiWaltricke BRMember ✭✭

    IOS and Android... thank for your help.

Sign In or Register to comment.