Xamarin iOS: UIStackView on the bottom-trailing angle

dxmanndxmann ITMember ✭✭

Hello everyone,
I'm editing a xib iOS UI and I have to add a list of items in a scrollview (in order to scroll elements inside) on the bottom- trailing angle (on the bottom right of the UI).
I can do this without the scrollview, but when I add the scrollview the list is placed on the top-left of the scrollview.
What can i do?
Constraints:

  • between: Scrollview-bottom and bottom = 8
  • between scrollview-right and right = 8
  • between scrollview-top and top >= 8
  • between scrollview-left and left >= 8
  • between scrollview and stackview: equal width and equal height

Best Answer

  • dxmanndxmann IT ✭✭
    Accepted Answer

    Solved:

    • from the graphic editor I have added all constraints;
    • from the code behind I keep enabled only constraints that are needed in order to shape the scrollview;
    • the stackview is conneted to the scrollview with top, bottom, left and right constraints =0;

Answers

  • dxmanndxmann ITMember ✭✭

    The question can be rewritten as: how can I put a stackview on the bottom-right of a scrollview? (if I have some items they have to be placed near the bottom-right angle both horizontally or vertically)

  • JuniorJiangJuniorJiang Member, Xamarin Team Xamurai

    Hi,@dxmann do you mean always show a stackview on the bottom-right of a scrollview?If you just use one scrollview contained stackview,that will be impossible to show you want.

  • dxmanndxmann ITMember ✭✭
    Accepted Answer

    Solved:

    • from the graphic editor I have added all constraints;
    • from the code behind I keep enabled only constraints that are needed in order to shape the scrollview;
    • the stackview is conneted to the scrollview with top, bottom, left and right constraints =0;
Sign In or Register to comment.