UITableView inside UITableViewCell in cellForRowAtIndexPath - iphone

Is it possible to create an UITableView inside UITableViewCell?
I want to create layout like this. In that i have Taken one MainUItableView and other is the SubUITableView. MainUItableView consists of SubUITableView. For example Classification is part of SubUITableView which is kept in MainUITableView.
You can find out the layout image which from this url : http://filedb.experts-exchange.com/incoming/2014/08_w35/869555/IMG-1101.jpg

Related

2 CollectionView inside the TableView Cell not working

I'm working on ui that has basically two categories first is categories and second one is products when user click on any category the products load accordingly.Category showing in horizontal direction and products showing in vertical direction.I'm using tableView and inside the tableView cell I'm using two collectionViews.All outlets are connected when I running code (could not dequeue a view of kind: UICollectionElementKindCell with identifier CategoiresCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard") occurs.Also I'm using tableView height method I' want dynamically calculated and also in collectionView I'm using sizeForItemAt for calculating the height so how I can calculate the dynamically height accordingly to content in tableView as well as in collectionView according to tableViewcell.
I want this layout
My code pics
Error:
We have had the had the same problem with sizing of TableViewCell and dealing with accessibility large font and collection views, the way we got around that was to get the table view cells to to relayout there contents a second time, it seem like the cell needs to layout there subview again with something like layoutIfNeeded, it was a work project, so I don't have access to anymore and can only go by memory, but hopefully this will point you in the right direction.

A custom headerView like iPhone contacts image and small UITableViewCell

I am trying to get an application that has UITableview with a custom header view. I want the header view to be quite similar to the iPhone contacts app (see picture) when you are editing/adding a new contact i.e. a small image to the left and 2 to 3 static text entry cells on the right that look like the UITableView Grouped cells.
Whats the easiest way to achieve this design in IB or Code (without Story board)? At the moment it seems like I have to create a Parent UIView, add an image on the left and add a UITableView on the right and populate it with UITableViewCell dynamically. But this seems cumbersome and means I have to implement another class with a UITableView delegate protocol to populate the UITableview cells in the header.
Is there an easier way to do this?

Multiple columns within TableViewCell [duplicate]

This question already has answers here:
How to display multiple columns in a UITableView?
(6 answers)
Closed 10 years ago.
I'm creating an iOS app and will to create Table view cell with 3 columns inside of it. For example instagram profile page that contains the user information. Can this be achieved within xcode? I'm using a storyboard.
Yes it is very much possible in XCode. You'll have to create a custom UITableViewCell to create this. In your custom UITableViewCell you'll have to create different components as per your need.
I believe the yellow box in above pic is what you want to achieve. For this :
You'll have to create one custom cell with 3 UIImageView
EDIT :
In your UITableViewCell you'll have to create one UIImageView to show the profile picture.
Two UILabel one for the statistic. And, one for text.
One UIButton for Following.
How About the UICollectionView instead UITableView.
Create a custom cell.
You can either create the cell in interface builder or subclass UITableViewCell and overwrite its initWithStyle and layoutSubviews classes. You can access their properties within cellForRowAtIndexPath as usual. You could even do the layout in cellForRowAtIndexPath but I would not recommend that simply because of its bad style. For the user there would not be any difference.

iPhone UITableViewCell with checkbox

I have a custom-subclassed UITableViewCell which will include a few labels, to which I want to add some checkbox functionality. One question label and five options are multi-selectable in that UITableviewCell subclass
Since I'm already in a cell, is it possible to use UITableViewCellAccessoryCheckmark to imitate checkbox functionality? Another option would be to navigate to another tableview using UINavigationController, but I want the user to see the options in the same page.
Also, since I don't know the number of options beforehand, is it possible to design this custom cell using a XIB and yet still dynamically add some items (for example UISwitch, or UIButtons) at runtime? Or do I have to code it all without using a XIB?
In short, Yes.
UITableViewCell is a subclass (somewhere down the way) of a UIView. That said you can insert a UITableView in it and create your checkbox allike cells. Think of it as nested tables:
Table of questions -> question cell -> table of answers -> answer cell.
So what you want to do is to make your custom UITableViewCell implement UITableViewDelegate and UITableViewDataSource then you want to insert an UITableView in the IB.
When you want to show your question cell with 4 answers you would pass a parameter of answers as a NSArray to the custom UITableViewCell. It then will use it to create inner cells that will behave as answer cells.
Hope that helps.

Multiple images per row in UITableView's cell

Is there any sample code that would illustrate how to have multiple images within each row?
Typical apps show a thumbnail to the left side with text to the right. I'd like to do that plus an image to the right of the text.
How would I go about doing this?
In interface builder, simply create a tableview cell that looks like you want. Then create a UITableViewCell subclass that has properties pointing to the elements of the new cell. Set the class of cell to the subclass then add cells of that class to the table in the standard way.
A tableview cell is just a view and you modify it and use it just like any other view.
You'll have to create a custom UITableView cell. Here's an example of using multiple UILabels in one. Here's another.
Pretty easy - follow Apple's documentation to create exactly the cell you want in Interface Builder with as many UIImage or whatever else you like. Look at Table View Programming Guide for details on how to make and load the custom cells - just be careful about performance when you put a lot of visual elements in a table view.