layoutBox / PinLayout

Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to config a UIScrollView?

Larrycal opened this issue · comments

commented

I have a UIScrollView which contains some subviews, I'm puzzled when I want to use these views to determine the scrollview's contentSize and frame size.
For example, when subviews' width is more than screen's width, I want to change the scrollView's width to screen's width and the contentSize.width to the subview's total width.
But now, I use below method to achieve this.
tagScrollView.pin.below(of: likeButton).marginTop(10) .left(StatusTableViewCellHorizentalSpacing) .right() .height(of: tagScrollViewContentView) .maxWidth(Constants.screenWidth - StatusTableViewCellHorizentalSpacing) tagScrollView.contentSize = tagScrollViewContentView.size

Closing this old issue