how to reduce spacing between multiple table views? - ios

In this I had placed two table views on a single scroll view so that i had given constraints where as coming to landscape mode the space between the first table view and the other table view is increasing and is as shown here :
In portrait it works fine and there is not that much space can anyone help me how to reduce this ?

Bad idea using two table Views in scrollView. Use one tableView and make manipulate with items in dataSource which fill tableView, after items changed reload needed cells, and table view redraw.

Related

ioS Scroll View with dynamic table View

I want to create a “ViewController” Scene with a “Scroll View” and in this view there should be a “Table View” at the top, 1 “segmented Control and 2 tables at the bottom.
The “Segmented Control” should switch the bottom table views.
Like in this picture:
My problem with this scene is that the table should have a dynamic height.
I need the bar over the complete page and not in the individual tables.
Is it possible to create such a scene and if yes, which constraints do I have to set?
I hope you can help me! Thanks a bunch!
tableView inside scrollView is a disastrous idea, because
tableView itself have its own scrollView.
Scrolling will be very sticky and it may freeze UI.
The best solution comes on my mind is to take single tableView and manage multiple sections.
The Green portion will be your first section.
Segment control will be second.
and blue section will be third.
In this way you can achieve both dynamic height as well as single scroll bar condition.
Let me know if it works.

One section of the view controller is still and one section horizontally scrollable

I would like to construct a view controller where one section of the view controller would be still and one section scrollable.
Both sections have headers where as well, one is still and one is moving along with the content in the section.
I do not want the cells in the section to be scrolled separately. All cells should move at the same time along with the header.
I have added an image to make my point little more clearer.
Use UICollection View for both view and disable scrolling for one view and enable scrolling for another view
you can probably add to your UIViewController view a UITableView on the left with fixed size (for example 150px) and vertical scroll disabled and a UICollectionView with horizontal flow and ,if needed a, with custom UICollectionViewLayout (but i think that you just need the classic UICollectionViewFlowLayout) for the right part that fits the remaining space.
Here you can find the component's documentation:
https://developer.apple.com/reference/uikit/uicollectionview
https://developer.apple.com/reference/uikit/uitableview

Is there a better way making horizontal scroll between different table views?

I need to implement the following feature:
I need to show a user list of many table views containing many cells each. One table view at a time. So user scrolls up and down within current table view and scroll left and right to go between different table views.
The way that I implemented it right now:
I have a scroll view occupying full screen.
Content size for this scroll view is three times wider then size of the screen.
In this content I layout three different table views.
Only second (middle one) table is displayed initially.
When user scrolls right or left I catch the end of scrolling event and reposition content back to the middle view and reload all three table views.
Am I missing something? Is there way to optimize it?
Here is a github liker for SwipeView. Just to implement datasource to setup tableViews on. This is useful for me.

horizontal scrolling for each section in a table view

I want to implement a UICollectionView with multiple sections which each section scrolls horizontally and independently like the attached image
I suggest you to use UITableView with customized UITableViewCells with UIScrollView as subview on its contentViews.
There are many samples, for example here
You can use multiple UICollectionViews in table cells. The tableView will scrolls vertically and The collection views can be configured to scroll horizontally by setting particular set of properties which will restrict them to scroll vertically, and they will only scroll horizontally. One constraint to consider is it is much more difficult to do animations that need to move from one table cell to another and you can't use a neat single change of collection view layout to animate all the items in your table view. But if these constraints aren't a problem then this is a relatively easy solution. I also tried it once. It worked for me. Hope that it works for you as well.

iOS: Make embedded Tableview "automatically" so big, it doesn't need scrolling but only the parent view does

I want an embedded table view within a view. Depending on the user this table has 1-n rows. So the size varies. If I build it right now the table view has to be scrolled if n is too big. I however don't want the tableview scrollable, but I want to make it grow automatically so the user doesn't even see it's a tableview but instead the parent view surrounding the tableview should be scrollable. Or in other words, all rows of the table should be always displayed completely within the parent and depending on n the parent becomes scrollable. How can I accomplish this?

Resources