Flow Layout in Horizontal Mode


Hi everybody,

I’m looking for some good advice for resolve my problem. I need to use Flow Layout in Horizontal mode. I’m looking inside documentation and around this forum but I haven’t found nothing about. 

SEssentialsFlowLayout extends UIScrollView but I cant set the position of the views added with “addManagedSubview” methods. The contentSize setting seems to work correctly but without views position is unuseful.

Any help is welcome, thanks a lot.


Hi amaroldi,

If you just want to do some basic positioning of the views, the Flow Layout has the horizontalSubviewAlignment and verticalSubviewAlignment to control where the view sits in relation to other views in its row. There is also the horizontal/verticalSubviewSpacing, to set how far apart the views are, and the horizontal/verticalPadding to set how much padding around the edge there is. You can also rearrange the views by requesting them from managedViews, and calling reorderManagedSubviews:animated: with your new desired ordering.

The Flow Layout is intended to take control of laying out the views, so if you are trying to set the individual positions of the items yourself, then the Flow Layout will just reset the positions every time it reloads the positions of the items.

If you tell us a little about what you’re trying to build, we might be able to help further :slight_smile: