I am trying to make a table using uitableview on iOS 7 and 8 . The table is like the image below
I've tried doing it using uitableviewCell but the labels didn't adjusted well in iphone and iPad .. plus the auto layout was pain to handle.
My question is.. Is there anyway that I can do this even with uicollectionView.. and how in details please.
Any help will be appreciated
In your case, I think, custom table view cells are your best choice. You can create and arrange them them in the storyboard and set appropriate IBOutlets.
You can follow this tutorial, wich describes the pattern really good.
Have you tried some third party component? There is nice demo on GitHub for MDSpreadView component.
Link: https://github.com/mochidev/MDSpreadViewDemo
A way to make multiple column table would be to have:
1) A different
UICollectionViewCell
for each item.2) A separate view for the headers, just to not clog the datasource with non data info.
3) Careful management of cell classes and positioning in each section, where each section is a row and each cell is a column entry.
like an example. Obvisously there are many things you must configure, but I think is good start point:
.h file:
.m file
You might need to write the methods to work properly if you want work in portrait and landscape. (rotate). But It´s the same code in the rotate methods.