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
I have a problem, I created a uiview with image , but the minMarginPxBetweenItems can't be less than 0px . If I set minMarginPxBetweenItems = -8.0 ( between 0 and -7 not change nothing), the subviews overlap. How do I set no margin between items?
tnx :)
The text was updated successfully, but these errors were encountered:
minMarginPxBetweenItems is only the minimum margin between items, the actual margin would be depended on the scrollview and items size as well as the miniAppearPxOfLastItem. You can see more details of how to calculate actual margin at calculateMarginBetweenItems method
To achieve your target, you need to do little bit math. Firstly, set minMarginPxBetweenItems to 0, then get the width of your items. For example, let's say your scrollview width is 300, if you don't want any item show in the right edge, set miniAppearPxOfLastItem to 0, then the width of items should be (300-leftMarginPx) / [numberOfItem you want to show, let's say 10] then the width should be (300-10)/10 = 29
horizontalScrollView.miniAppearPxOfLastItem = 0 //it can be any value
horizontalScrollView.leftMarginPx = 10
horizontalScrollView.miniMarginPxBetweenItems=0
horizontalScrollView.uniformItemSize = CGSizeMake((horizontalScrollView.frame.size.width-horizontalScrollView.leftMarginPx-horizontalScrollView.miniAppearPxOfLastItem)/10, 50)
...
I have a problem, I created a uiview with image , but the minMarginPxBetweenItems can't be less than 0px . If I set minMarginPxBetweenItems = -8.0 ( between 0 and -7 not change nothing), the subviews overlap. How do I set no margin between items?
tnx :)
The text was updated successfully, but these errors were encountered: