-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll View add to Table View Cell #8
Comments
Your horizontalScrollView has a fixed width = containerView.frame.size.width, if you don't have auto layout code to adjust the scrollview and the container view, then it should be fit. As I can imagine, your container view do have auto layout setting on it to resize the width. But the horizontalScrollView is not adjusted correspondingly. If this is the case, I suggest your add constraints to horizontalScrollView too. Again, your tableview cell width is limited to the table view, but the horizontalScrollView width is not, adjust your horizontalScrollView width correspondingly. |
I got it. Thanks terenceLuffy 👍 |
Set the horizontal scroll view frame to fixed width and adjust with constraints. Its looks fine.But the last items doesn't appear fully. And margin between items is not ok in 4s but fine in 6s. here my code... let horizontalScrollView = ASHorizontalScrollView(frame:CGRectMake(0, 0, 300, 150)) |
Your code seems correct. But you can check on two things to make sure:
The gap differences in 6 and 4s is normal. Because the screen width is different. In 5s and below, it is 320, and 6 is 375, 6 plus is 414. Therefore, you should have different width and gap for different phones. |
Hi TerenceLuffy. How can i pin the last scroll index in HorizontalScrollView. For example add the horizontalScrollView to TableView. When scroll the tableView the horizontalScrollView index lose and show the first index ever. |
I guess you reuse the table view cell which contains the scroll view? I suggest you don't do that because you probably won't have same items for all scroll views? If you don't reuse the cell for other cells, it won't move the scrollview's index. |
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.
here is my code...
The text was updated successfully, but these errors were encountered: