-
-
Notifications
You must be signed in to change notification settings - Fork 10
Card interface (similar to Snapchat or Duolingo), Incorrect behavior on iPhone X-series #46
Comments
Hey @richardtop, I might be a bit of a dummy here but I'm unsure of what the issue is, or how to fix it :) |
BTW, those two examples are meant to be only examples... Of course, they're way easier to achieve with the UICollectionView. However, this idea (and this library) becomes relevant when the "cards" are of different content and load data from different sources. |
Yeah I'm with you that far but what are the features that you are missing in |
@zenangst .... sketching some examples... |
Let's consider red and blue tableviews and compare them against the default "Settings" app. In "Settings" the content scrolls past the margins freely, so it seems like the content goes "off-screen". If we consider the double table view controller example with Family, both of the controllers are trimmed by the framework before their content goes off-screen. To fix this issue, the two child controllers should extend beyond the visible area a bit. This would allow for the cells to go off-screen and only then recycled. If you run the demo I've attached, there is a noticeable jitter in the edge parts of the both tableviews. |
Adding some margins, so the tableviews' frames extend beyond the visible range would allow for an effect - rounding corners of the tableview. The resulting tableviews look like infinitely scrollable cards, an effect similar to the example attached by the in the example graphics, the filled rectangles are the actual frames of the tableviews and the bordered rectangles define the content of the tableviews. If the user scrolls to the beginning of the tableview, it would appear as a rounded card. When the user scrolls past it, the table would become a standard list (as shown on the centered image). This UI is used in many apps and it would be very easy to reproduce it with the Family. With Family it would be extremely straightforward and solved by just adding two tableviews. Of course, I didn't even mention the fact that it would be possible to combine table and collection views in one screen. The controllers would be completely independent of each other and manage data loading, display and navigation. |
Hey @richardtop, sorry for the delay. Life has been hectic this fall, I've started investigating this issue and I'm working on a PR that might help you along the way. I've optimized the layout algorithm to be even faster for iOS and tvOS. macOS already got the implementation here - #52 The Reference: 836b29b And last but not least, instead of adding support for custom spacing (which was initially inspired by If you are feeling adventurous, you can try As for your points in having decoupled controllers, combining table views and collection views in on controller... I couldn't agree more, it is kinda what I wanted to solve with the framework, to begin with. Again, sorry for the lack of response on this issue, I wanted to solve it for a while now. |
I just went total #yolo and merge it into |
Cool, I think that's what I requested. A nice feature to have for this library. |
@richardtop I also investigated the UI stutter, that should be fixed in |
Is it possible to use Family to create a card-like interface, similar to Snapchat or Duolingo with multiple rounded cards that scroll infinetely?
So far I was able to achieve a very similar effect, but with some flaws using this code:
The result looks like this:
So, the problem is really with the outer corners which should not be visible if there is some content further down (or up) the table.
What would be ideal is to add some padding where the views could extend before being recycled.
I.e. currently the tableviews are limited by the
FamilyController's
alignment rect, or at least, respects the top and bottom safe area insets. Because of that, the layout looks weird on the X-series phones.Having some parameter (i.e. margins to extend) would give an option to both achieve the card-like looks and fix the x-series bug.
Video Description
The text was updated successfully, but these errors were encountered: