I would like to display tabular data in a view in an iphone application.
The data i want to show is 10 columns wide and about 8 rows. The columns are mostly integers except for one column which will be a name. These 10 columns won't fit on the screen so i would include a scrolling view to allow users to scroll the table in a vertical direction to be able to view each column. But i can't figure out how to show multiple columns of data.
I've looked into Shinobigrids but this solution is quite expensive. Are there any other grids available which are open-source or are there any tutorials on how to build these yourself?
You can either create a single table view with custom cells, and each cell to have multiple columns, or add multiple tables to a UIScrollView (I'd prefer this one) and you can scroll each column individually.
Try using collectionView it displays a collection of cells through which users can scroll. Each cell in a collection view is a UICollectionViewCell object. Hope this helps you..;)
Related
as I say in the title, I'd like to display two or more cells on the same row. I have every cell with a UILabel inside. The labels can have changing width depending on user's input. I'd like to fill a row with many labels as I can. Can someone give me some advice on how to do it? Thanks.
Short answer: You can't. Slightly longer answer: Use a collection view.
Table views are designed to show a single column of cells.
You can't make a table view contain multiple cells in a row.
You could probably create a view controller that had side-by-side table views inside it, but it would be awkward and hard to use, and the table views would scroll independently of each other.
If you want multiple cells on the same row, you want a collection view. A collection view is similar to, but more flexible than, a table view.
I would consider using a horizontal UIStackView to achieve what you're trying to do. Depends on how dynamic and changeable you need it to be.
I am developing port of application from android. In my application In one of screens I present to user collection of parameters grouped by sections. Every section is presented as page of tile items in spannable grid. User can scroll betwen sections horizontally like in pager while pages are not scrolled vertically. Additionally on top of screen user has clickable tabs showing all availible sections by title. On android I achieaved this by creating nested RecyclerViews (one lvl for sections, one for tiles), combined with DiffUtil for quick content updating.
I am completly new in iOS development but I want to create something similar. After little dive into basic components it sems like UICollectionView might be the rightest joice. In my app I am trying to use MVVM approach using RxSwift and RxDataSource. The last one has support for sectioned UICollectionView and I wonder if there is any possibility to create the whole view by using single UICollectionView. Sections would scroll horizontal and every section would contain grid elements? Or maybe can I nest one RxDataSource in other. Or maybe I cant use RxDataSource for this and i should try something else. To make clear what I am talk about i include image
I would be very gratefull for any advice because I could not find anything usefull by my hand.
I would set it up as:
UICollectionView (main)
UICollectionViewCell (single cell for whole screen - horizontal scroll)
UICollectionView (inside a cell)
UICollectionViewCell(s) (vertical scroll)
You can have a cell that takes a whole screen or is a small rectangle, it's up to you
I would like to create the following, but not absolutely sure which one is the best to use: UITableView or UICollectionView?
Table views only do a single vertical list of cells. If you need a grid with rows and columns then you need a collection view.
If the 3 parts of your A-G rows are separate sections of single items then you might use a table view. (Say the left column contains an image, the middle column contains a title and subheading, and the right column contains a description of the item.)
I'm working on a Netflix-styled UI, a table with rows that can scroll horizontally.
A few years ago I coded this up as collection views inside a table view.
Now I am wondering whether I can do this with a single collection view, with a custom layout. The advantage of the new approach is that animations that go from one row to another row can be done with layout transitions, something the collection view supports natively.
Can this be done? I don't think it's possible, but I am curious what you think.
I need an advice for a thing I want to implement for an iPhone application.
Actually what I want is to have the ability to dynamically populate a TableView with a specific template delivered by an engine (is it clear ? ...)
For that I want each of my TableViewCell of the TableView to be a UICollectionView.
For example :
I want to display an image, a title and a subtitle in my cell (I know I can do this by using a UITableViewCellStyleSubtitle, but when I have more complicated things to display it won't work with it).
For that, I want a UICollectionView with 2 columns and 2 rows on each column. The first item (image) will be placed on 0,0 with a 2 colSpan (to take the whole column). The second item (title) on 1,0 and the third item (subtitle) on 1,1.
I also want the collection view items to be sized correctly.
So 2 questions :
1) Is it a good way to work with a UICollectionView, or is there simpler ways ?
2) How can I specify rows and columns, along with colspan and rowspan in a UICollectionView ?
Thank you very much for your answers :)
A collection view is overkill for this. Just define a cell with custom subviews. You can resize them if required when the cell is populated. You haven't said what the most complex or simplest layout will be so I can't offer any more specific advice.