There are two views in my screen. The first part consists of a map and the second part consists of a tableview. After dragging the tableview part upwards the tableview occupies the entire screen. How to achieve this in ios?
First the bottom part should be a collectionView , second you can use UIPanGestureRecognizer to detect user pan and update the origin Y of the collectionView
Related
I am trying to create a tinder like swipe left and right in UITableView cell. Here, the tableview cell contains an image view which I can move around with pan gesture. When I initiate the gesture on the image view, I want to move it freely over my device screen.
I am facing the problem that when I move the image view around it goes below the current cell. How can I bring the image view over all others so it doesn't go below the cell frame?
I tried using view.bringSubviewToFront but it doesn't work.
Please suggest a way I can achieve this.
An image view still contained in a cell is not going to be reliably brought on top of all other relevant views. You will have to move that view from the cell to the table view's parent view while dragging (and then return it to the cell if necessary at the end).
You will probably want to look into UIView.convert(_:from:) to figure out the frame to move the image view to in the parent view.
Need to implement horizontal scroll view UI exactly same as the attached two images. I need the selected view to be at center and magnified while the remaining two of the view edges must be shown.
I'm trying to create a table with a fixed first column and row. I tried to implement it like the scheme below (it's a vertical UIScrollView with a horizontal UIScrollView inside). The problem is that I need to make them move together if I drag my finger across the screen diagonally with the acceleration and bouncing animations. I already tried creating a view on top, getting the movement with touchesBegan: and touchesMoved: and changing the contentOffset programatically but it has laggy and without acceleration and bounce. Any ideas? Thanks in advance
scheme:
From the first look:
Parent View: ScrollView with vertical Scroll only.
Inside:
First Row: UICollectionView (with horizontal scroll)
First Column: Normal UIView (or table view or colleciton view - depends on your setup)
The rest of cells: UICollectionView with horizontal scroll
Add an array value at the index path 0 manually. So that you will get a cell value constantly.
I have 3 viewcontrollers inside a UIScrollView that page horizontally. each viewcontroller has a tableview within it.
I can swipe between the 3 viewcontrollers easily when the active table is still (not scrolling) - but when i try to page left or right when the tableview is moving it seems to ignore the touch and gets stuck. I have to stop the tableview with a touch before paging (almost as if the tableview is trying to receive the horizontal gesture)
how can I make my scrollview always react to a horizontal paging
here is a visual of my setup:
tell me if you need any more info
There are multiple ways to get around this.
One way is that you could manage the horizontal scrolling yourself with UIGestureRecognizer. So if there is a left swipe then scroll horizontally to the left and vice versa for right swipe. That way if a UITableViewController is vertically scrolling at the time of the horizontal swipe, it won't have to wait until it is stopped to detect it.
my app requires an object to be translated according to the user's touch on screen like Tinder. The objects are presented in UITableViewCells inside a UITableView. When I translate an object, the object goes under the top cell and it moves over the bottom cells. Please refer to the screen shots provided. My question is: How can I let the object move over the top cell while translating as well?
So, your Z-index is based on the order that views were added to the container. You should be able to call bringSubviewToFront: on your UITableView and pass in the cell you want to have on top. Then it should display over both the top and bottom cells.
Okay What I did is that where I'm handling the panning, when the panning begins, I type in
[self.superview bringSubviewToFront:self];
Hence, every cell in use will be automatically brought to the front.