Skip to content

Scroll View add to Table View Cell  #8

Description

@PaingSoe93

Firstly i add the horizontalScrollView to UIView seen no problem. But Added to table view cell does not show the last items and scroll view width is beyond the container view.

screen shot 2016-06-07 at 11 08 35 pm

here is my code...

     let horizontalScrollView = ASHorizontalScrollView(frame:CGRectMake(0, 30, containerView.frame.size.width , 150))
    horizontalScrollView.backgroundColor = UIColor.blueColor() //add color for testing
    horizontalScrollView.leftMarginPx = 30
    horizontalScrollView.miniMarginPxBetweenItems = 15
    horizontalScrollView.miniAppearPxOfLastItem = containerView.frame.size.width-(200+30+50)
    horizontalScrollView.uniformItemSize = CGSizeMake(200, 150)
    //This must be called after changing any size or margin property of this class to get acurrate margin
    horizontalScrollView.setItemsMarginOnce()
    for nub in 1...7{
        if let addView = NSBundle.mainBundle().loadNibNamed("ScrollViewController", owner: ScrollViewController(), options: nil)[0] as? ScrollView{
            addView.titleLable.text = "\(nub)"
            horizontalScrollView.addItem(addView)
        }   
    }
    containerView.addSubview(horizontalScrollView)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions