Hi I am trying to achieve this:
Every search gives me a horizontal list that is contained inside the card and every image disappears into the cards border. Any tips on how to achieve this effect?
First of all, I'm not sure if your question is a programming question, but I'm answering your question anyway.
So you could have UICollectionView and each item (row) has another UICollectionView.
Since I prefer UITableView most of the time, I would use UITableView and each row (each UITableViewCell) has a UICollectionView for displaying the horizontal scrolling albums.
The white container in each cells/rows is merely a UIView with constant height and dynamic width (leading and trailing are clipped to the superView with inset, say 10.0). Then the UICollectionView is clipped to the superView (UITableViewCell) with no offset or zero offset/inset.
If for adding shadows to your view with rounded corners, there are multiple ways to achieve that, but I'm giving you a quick link for your reference: https://medium.com/swifty-tim/views-with-rounded-corners-and-shadows-c3adc0085182
I hope this helps!
Put three collection views that that stretch between the card borders. Let the collection views have a transparent background.
Then place the three smaller white views behind the collection views. Give these views a drop shadow.
Related
I’m trying to sync two collection views proportionally for navigation. One of the collection views is menu-like and is at the top, and the second is a larger one below. What I would like is for the top collection view to scroll a distance of the width of one cell (the cells are dynamically sized) when the user scrolls the bottom collection view a distance of the main screen’s width. The closest thing I've seen to this effect would be iOS: Custom top segmented control works as expected only when using debugger. What I would like to change is to have the left most cell in the top menu always selected. In addition, when the user scrolls the bottom collection view the width of the screen, a new cell should Replace the left-most cell in the upper menu and be selected. Any help in Swift would be especially appreciated, but ObjC answers are also welcome.
I currently have a table view populated with a series of posts. What I am trying to achieve is to manipulate the table view scroll so that there is always one table view cell centred in the table view. I'd also like this to have some form of scroll snap, similar to a vertical carousel in which the centred / focused cell has a maximum alpha and original size, and the cells visible above and below are smaller and have a lower alpha. I have attempted using scroll target offset but with no luck. I am mainly struggling with the mathematics of the function.
The image below demonstrates what I am trying to achieve.
What I am looking for at the very least is a push in the right direction in regards to how I can manipulate the table view scroll to have this type of carousel function.
EDIT: Is it possible to achieve this with Paging in the Table View?
I was wondering want the best way to add drop shadows to a set of collectionviewcells that do not have spaces between them?
Background
Part of my layout has various cells positioned across the screen like a post. It notes and the second half of the layout is structured to look like a tableview except all the cells don't go to the edges there's a bit of padding. So I can't really add a shadow around the collection view itself.
I have added shadows to the cells in the post. It note part which works great because the cells have spaces between them but I'm now struggling with the second half (the tableview looking part) because obviously when you add the shadows to the cells depending on the zIndex you may see the shadow overlapping the below or top cell.
So I was wondering what is the best way to do this?
Should the shadows decoration views underneath the cells?
OR
Should the shadows be attached to the cell and increase the ZIndex for each cell so they appear on different levels hiding the shadow - but that leads to a question on how to do the first cell and have a top shadow?
OR
Should I almost fake it by using an image of a shadow inside the cell itself?
I also have deletion functionality so I need to figure out how to make sure if I delete the first cell, the second cell should then have the top shadow in a nice animated way.
EDIT:
I am trying to create the following view inside the collection view. I have got the layout correct. 1
The green lines are the shadows I have working but the red are the ones I'm having trouble with and the boxes are the different cells.
I need to horizontally scroll through a list of thumbnails at the bottom of the screen that shows all the user's recently taken photos / videos.
I created a UIScrollView with a UITableview inside of it.
Is this the correct approach because I can't seem to find an override method in its superclass for scrolling direction?
Most of the topics I can find online deals with putting a UIscrollview inside a TableCell, which will not work for my specific application?
The hierarchy is:
View > Scroll View > Table View > Table Cel > Content > PhotoThumbnail
Below is a screenshot of what I'm trying to do:
I am not really sure why do you want to use UITableView for horizontal scrolling which lay out there cells in vertical manner. If you want horizontal scrolling I would recommend using UICollectionView where cells can be added horizontally or vertically or both.
Still if you want tableview to be scrollable in horizontal direction I would suggest you to check this project to get inspiration or using it.
https://github.com/alekseyn/EasyTableView
Instead of using UITableView you can use UICollectionView to achieve the desired result i.e, horizontally scrollable cells with imageView and other elements that you need.
I am working on a project to get custom news feeds from Bing news. I created a custom table view cell and populated various UI items in it. But I am having a hard time to make it occupy the entire screen, it starts from extreme left and ends on the right, leaving large gap from the right margin as show in the image. Can anyone help me out, how to correctly fix it with a detailed explanation of how constraints work in Table views and Tableview cells.
Here' what it looks like in the simulator
Remove previous constraints and add constraint to your UITableView like as shown in below image.
So you UITableView will have 0 margin from edges.
Create a UITableViewController. Just drag drop a TableViewCell into it. Add identifier for that cell and use it. By default it will occupy the whole screen.
In your case I guess you might have added constraints to UITableView. Here what you should do is pin your UITableView to Top,Bottom,Right & Left or make UITableView's width equal to SuperView.