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
`let horizontalScrollView:ASHorizontalScrollView = ASHorizontalScrollView(frame:CGRect(x: 0, y: Y, width:ScreenWidth, height: 50))
//for iPhone 5s and lower versions in portrait
horizontalScrollView.marginSettings_320 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 5, miniAppearWidthOfLastItem: 20)
//for iPhone 4s and lower versions in landscape
horizontalScrollView.marginSettings_480 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 5, miniAppearWidthOfLastItem: 20)
// for iPhone 6 plus and 6s plus in portrait
horizontalScrollView.marginSettings_414 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 5, miniAppearWidthOfLastItem: 20)
// for iPhone 6 plus and 6s plus in landscape
horizontalScrollView.marginSettings_736 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 10, miniAppearWidthOfLastItem: 30)
//for all other screen sizes that doesn't set here, it would use defaultMarginSettings instead
horizontalScrollView.defaultMarginSettings = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 10, miniAppearWidthOfLastItem: 20)
horizontalScrollView.uniformItemSize = CGSize(width: 80, height: 50)
//this must be called after changing any size or margin property of this class to get acurrate margin
tab1.addSubview(horizontalScrollView)
for _ in 1...20{
let button = UIButton(frame: CGRect.zero)
button.backgroundColor = UIColor.purple
horizontalScrollView.addItem(button)
}
horizontalScrollView.setItemsMarginOnce()
horizontalScrollView.refreshSubView()
scroolview.addSubview(tab1)`
The text was updated successfully, but these errors were encountered:
How to use in the ScrollView?
`let horizontalScrollView:ASHorizontalScrollView = ASHorizontalScrollView(frame:CGRect(x: 0, y: Y, width:ScreenWidth, height: 50))
//for iPhone 5s and lower versions in portrait
horizontalScrollView.marginSettings_320 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 5, miniAppearWidthOfLastItem: 20)
//for iPhone 4s and lower versions in landscape
horizontalScrollView.marginSettings_480 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 5, miniAppearWidthOfLastItem: 20)
// for iPhone 6 plus and 6s plus in portrait
horizontalScrollView.marginSettings_414 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 5, miniAppearWidthOfLastItem: 20)
// for iPhone 6 plus and 6s plus in landscape
horizontalScrollView.marginSettings_736 = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 10, miniAppearWidthOfLastItem: 30)
//for all other screen sizes that doesn't set here, it would use defaultMarginSettings instead
horizontalScrollView.defaultMarginSettings = MarginSettings(leftMargin: 10, miniMarginBetweenItems: 10, miniAppearWidthOfLastItem: 20)
horizontalScrollView.uniformItemSize = CGSize(width: 80, height: 50)
The text was updated successfully, but these errors were encountered: