AppStoreStyleHorizontalScrollView icon indicating copy to clipboard operation
AppStoreStyleHorizontalScrollView copied to clipboard

How to use in the ScrollView?

Open BadDeveloper2022 opened this issue 7 years ago • 3 comments

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)

    //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)`

BadDeveloper2022 avatar Mar 06 '17 12:03 BadDeveloper2022

I don't get what your question is.

terenceLuffy avatar Mar 06 '17 15:03 terenceLuffy

This control can not be used in ScrollView I add this to the ScrollView, but I can't scroll

BadDeveloper2022 avatar Mar 07 '17 02:03 BadDeveloper2022

This control itself is a scrollview, why do you add it to a scrollview?

terenceLuffy avatar Mar 07 '17 05:03 terenceLuffy