Search Unity

Unity UI Create 2 panels for portrait and landscape - like the android phone app

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by newguy123, Jan 10, 2019.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    135
    Hi guys

    With Android 8.0, the default phone app appears to be mainly 2 panels. In portrait the number buttons is at the bottom, filling the width, but about halfway in height. Above that, is the contact list where your contacts show up, also filling the width, and about halfway in length.

    When in landscape however, its not filling the width anymore, but the height, and now the width is about halfway.

    I cant work out how to achieve that type of layout. Closest I can think of is anchor the one at top left and the other at bottom right, but then how to achieve the rest, taking into account it should work on all devices and aspect ratios.
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    660
    hi @newguy123,

    It is not easy to achieve that out of the box. Therefore I wrote an asset "Better UI" which takes care of correct sizing for any screen sizes.
    In the version 2.0 I also added a big feature to change the UI layout for different screens (or orientations) while using the same objects.

    In my signature you can find some information about Better UI.
    here you can find information about the Beta of version 2.0.
    If you are interested in the beta, please write me a PM.
     
    newguy123 likes this.