You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, horizontally expanding layouts aren't built in yet. The two built in layout algorithms (grid and table) are designed to expand vertically. They base their content width off the width of the container (eg the parent MGScrollView or MGBox).
It probably wouldn't be a big task to add a new layout algorithm for horizontally expanding grids. Either configurable with a new contentLayoutMode value, or perhaps a boolean to distinguish between vertically expanding and horizontally expanding. The logic would be essentially the same, just with a handful of if conditions and CGFloat additions twiddled around.
If you want to have a crack at it, the relevant code is in MGLayoutManager.m
@sobri909: to me it makes most sense that this functionality apply only to grid layouts. Is there any reason for this to be adapted for table layouts as well?
I'd prefer to eventually have it available for both layout modes. There are some use cases. But no sense in building something you don't need, so if it's not useful to you, I wouldn't waste time coding it up.
Note that layout code is currently duplicated between the box provider system and the older layout API. It's not ideal working conditions inside MGLayoutManager. Again, I'd say only code it up for the layout engine you need it for (ie box provider or old API). Eventually that stuff should be deduplicated and refactored into something more sensible. Though it's fiddly stuff.
At the moment I want to scroll only horizontally.
but after calling:
My scroll views content size width is set to standard width for detail view which is 706 pixels.
But my Grid has a greater width and it is then not horizontally scrollable.
I was forced to manually set scrollable area (contentSize) after the layoutWithSpeed method.
[Code below]
The text was updated successfully, but these errors were encountered: