I have one UICollectionView with many sections and cells. I have used custom UICollectionView layout to achieve this design. It has scroll on both horizontal and vertical, with some static cells. Check the video for more details. All the data is setting proper.
Video Link.
Issue is with dragging. I want to drag the cells in the vertical direction and if its within the visible cells there is no problem. But when the cell is drag to scroll the UICollectionView and to bottom there is layout issues with top sticky sections.
Blue remains static when scrolling from left to right and red remains static when scrolling to bottom.
I have implemented drag using longpress gesture. And used CADisplayLink to scroll the UICollectionView while dragging. It would be better if any suggestions on how to scroll the UICollectionView while dragging the cell and how to keep the sticky cells without and layout issues.
Related
I have a scrollview embedded in a cell of tableview. The scrollview is a Foxit PDF rendering engine.
I want to scroll vertically the tableview, horizontally the scroll view. I couldn't. As on the first GIF you see scrollview is bouncing even the content height and scroll height is equal. But at least paging is possible.
Then I added a custom scrollview over the Foxit view into the cell. The bouncing disappeared and scrolling up and down the scrollview scrolls the table view. That is good. But now I can not horizontally scroll and change pages of the PDF.
What to do how to "merge" the two approach?
Try to play with panGestureRecognizer of scrollView and tableView. Install a relationship to prevent scrollView getting gestures before tableView scrollView.panGestureRecognizer.require(toFail: tableView.panGestureRecognizer).
I am intersted in a layout very similar to the App Store app, the "Featured" tab. I think I can achieve this by having a UITableView whose cells are horizontal CollectionViews. So that part is not really my question. The part that I have a question is that the top row of this UITableView scrolls out of the view if you pan (drag) up on the screen but it stick to the top when you pan down. I would like to know how I can achieve that stickiness in one direction.
Could anybody please help me understand if there is a way to provide the start position for horizontal scrolling in UITableView?
Basically, I have enabled horizontal scrolling by giving content inset like [self.tblData setContentInset:UIEdgeInsetsMake(0,0,0,500)];. But, I do not want the section headers to scroll. Is there a way that I can fix the section headers while scrolling horizontally?
If you want to scroll the view horizontally, i suggest that you should replace UITableView with UICollectionView。
If you want to scroll just one cell horizontally, you can add UIScrollView into cell.contentView.
If you look at the Featured tab of the Apple App Store app on an iPhone 6, there is a unique UI layout that I can't figure out how to replicate.
At the very top there is a navigationBar. Below this there is a UIScrollView that animates through a number of featured items. Below this is what appears to be a UITableView with a number of custom programmed cells.
My first guess was that the UIScrollView at the top was added to a custom cell at the top of a UITableView. If you swipe up the UIScrollView moves with the objects below like it is a cell. You can see that the vertical scroll indicator starts at the top of the UIScrollView.
The part that is unique is that if you swipe down, the objects below the UIScrollView move down like a UITableView and the UIScrollView stays in place. This means that the UIScrollView is not a custom cell at the top of a UITableView.
I tried making this work a number of different ways but I can replicate this. Does anyone know how this can be done?
You can use a tableview header,the header is a scrollview
If you scroll tableview up,just use tableview default behavior,the header will scroll up.
If you scroll down,use UIScrollViewDelegate to calculate the tableview header new frame,and adjust it.So it remain at top
Not sure if I got you correctly, you may use UICollectionView as vertical scroll. Then, you create a custom UICollectionViewCell, each with horizontal scroll.
I haven't tried it though but done something similar to this. Hope you find a way!
I have a problem with the creation of the layout shown in the picture.
Does anyone know how can I create it.
I want to link left tableview's (only vertical scroll enabled) horizontal scrolling with collection's view horizontal scrolling, and create scale view (only horizontal scroll enabled) horizontal scroll linked with collectionView horizontal scroll.
I know it is a bit chaotic, but I think that diagram best represents my problem.
I would also like to load collectionview's data in real time while scrolling.
At the end I will add that I am using the storyboard in my app.
Link to my schema picture