Hello I am trying to display multiple vertical table views inside of ONE horizontal view on iOS. Is this possible? The table views themselves should be able to scroll vertically like normal but I should also be able to scroll horizontally between multiple tableviews, all in the same viewcontroller (if possible). I have attached an image of what it should look like . As you can see, I should be able to scroll the tableviews vertically independently from the horizontal scrolling that is used to display different tableviews. All while keeping the header visible (Engineering, Scholarships, etc.
What strategy should be done on iOS/Swift, is there a tutorial? I am OK with using a UICollectionView instead or any other type of view. Thanks so much!
Related
I want to create collection view cells the width of which changes according to the label in them. The labels of the cells get their text value from an array declared by me. Is there a way to create auto resizable collection view cells which change their length accordingly without using custom classes or pod files?
Try experimenting with UIStackView. I'm pretty sure the elements can be auto justified. You'll likely be able create the layout you want with vertical and horizontal stack views.
If you select multiple views in the interface builder that are arranged horizontally or vertically you can embed them in a stack view.
if you multi select the views you want and press that button in the lower right corner of interface builder you should have an option to embed the views in a UIStack View
I always face problems with the UIScrollView which is:
I have a UIViewController that contains two tableViewControllers, the contents of these tables are bigger than the height of the iphone, so I need to use a scroller. I enable the scroll of the table, but the height of the table is big, so I need to scroll all the screen also, for this reason, I added a UIScrollView and I put these two tables inside, for now I have three scrolls, (for the two tables and for the UIScrollView).
What I need is: to allow scroll the tables with the scroll of whole screen, it means to combine the scroll of the table with the scroll of the UIScrollView.
Is there any method to combine the scrollers??
you dont need to put a UIScrollView behind the UiTableViews as the tableViews have their own scrollers. No matter how much data/cells you have in the tableView it will allow you to scroll easily.
Is is possible to implement smooth scrolling using both a UIScrollView and placing a UITableView at somewhere starting in the middle of the screen? The UIScrollView contentSize is elongated to accomodate the additional height of the UITableView. The UITableView should be able to contain unlimited and unknown number of rows. Scrolling the entire view downwards will cause the upper non-tableview portion to first disappear and then it scrolls down just like a regular table view.
Put it in another way, I'd like to implement a table with some fixed content before the top row. Think of it like a "header area" for the tables, scrolls up and giving way to the entire table rows.
I probably know that I can implement a TableView and programatically make the first row to contain some fixed images. In this way, it will work as expected. But which is easier to implement?
You really don't want to put the table in a scroll view. When the user scrolls on the table it will not move the underlying scrollview so you won't get the effect you are looking for.
Implement viewForHeaderInSection instead and pass in the view you want to display above the first row, or set tableViewHeader.
I'm looking for a clean way to implement a login screen in my iPhone application. I'd like it to appear as a grouped UITableView section with rounded corners and a separator line below between rows (like e.g. the sections in the Settings app). However, I'd like to give it a slightly smaller cornerRadius than the default setting of a UITableView section.
Another thing I'd like to do in that screen is to add a "register as new user" button which causes the whole screen to slide up, presenting the registration screen. There will be a background image that spans both screens vertically and should slide up with together with the content.
I was first thinking to just make a UITableView, set it to grouped, add two sections (one for login and one for registration), add some space between them and disable manual scrolling on the UITableView. However, I found that putting a background image correctly behind a UITableView and to make that scroll together with its content is a bit tricky..
Perhaps I shouldn't be using a UITableView and just write some code myself that can wrap multiple views (each containing a label and a textfield) together into something that appears like a UITableView section? I've been searching around but surprisingly it appears that not too many others are trying to solve this same problem.
Any suggestions would be very welcome!
Sounds like a UITableView is overkill for what you need. I would just create a custom UIViewController and have it handle the layout of all of your subviews as well as any animation you desire.
Just have the parent view take up more space than the device's screen. Then, when you want everything to slide up, animate a change to that view's frame property.
I have multiple column and row data , i want to place it in table view also i want make it scrollable vertically as well as horizontally . how to do this ? please help...
The UITableView is not meant to be used in a multi column way.
What you can do is to create custom UITableViewCells that look like two or more columns. But that will be just a workaround without the possibility to scroll horizontally.
The other possibility is to implement a UIScrollView. Add a View to the UIScrollView that is wider than the actuall iPhone screen. In this case the user will be able to scroll horizontally. In this case you will in deed not be able to use the predefined API-functionality of the UITableView and you have to render your table on your own.
My library, UIGridView, does what you want.
But it only supports vertical scrolling.
It is built with UITableView, in which UITableViewCell contains many cells inside.
You can try implement your own library, learn UIGridView's code, or use UIGridView.