UITableView with Multiple Columns [duplicate] - iphone

This question already has answers here:
How to display multiple columns in a UITableView?
(6 answers)
Closed 9 years ago.
Is it possible to create multiple columns in UITableView, as my requirement demand me to do this, If it is possible how i can i resolve this issue.
Thanks in advance.

You may use UICollectionView for that. Or simply build each UITableViewCell with needed labels and elements in cycle with columns count

First thing you need to do is take a look at UITableViewCell Documetation and Read the Content given there. If you read it properly, you'll get the Answer in the form of these Steps :
Create Custom UITableViewCell with UILabel equals to Number of Columns.
Use this UITableViewCell in your UITableView.
Fill each Row of UITableView with your Database Table Rows.
Tutorials to Integrate custom UITableViewCell :
Creating custom UITableViewCell from XIBs – step by step tutorial
Crafting Custom UITableView Cells
GoodLuck !!!

If you will use CustomCell there will be scrolling issue. So the best way to do this is UICollectionView for ios6. I did it with CustomCell also so if you are working for ios5 I will guide you.

Related

How to Change UITableviewCell Width [duplicate]

This question already has answers here:
Where is a good tutorial for making a custom UITableViewCell? [closed]
(6 answers)
Closed 9 years ago.
i am new to Iphone development, i want create a tableview that contains cells of different width, like iphone contacts app when clicked on add button a tableview appears having different sections and cell are different width compared to first and second sections.
any sample code for doing this.. ?
The different sections is a function of the tableview with UITableViewStyleGrouped. The different width cells are not individual cells. Each row is a tableviewcell. Each cell can be customized to look at any you want. So 1 tableviewcell can have 3 fields in it, like City, State, and Zipcode.
Google is your friend for the sample code.
J

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.

UITableView - expanding cells [duplicate]

This question already has answers here:
Expand/collapse section in UITableView in iOS
(17 answers)
Closed 7 years ago.
I managed to expand my cell (after many tries) as you can see in my pic.
but what I really want is something like this:
as you can see when the user click on description the cell expand showing the content:
Can please somebody tell me where I can find all the info to do that. (I struggling to find them). thank you very much!!!!!!
You can try apple's source code in your application- http://developer.apple.com/library/ios/#samplecode/TableViewUpdates/Introduction/Intro.html
or you can fallow this blog -
http://www.cocoanetics.com/2011/03/expandingcollapsing-tableview-sections/
and you need to add custom UITableViewCell design as per your need.
Change the height of the cell in tableView:heightForCellAtIndexPath:, change the cell layout in tableView:cellForRowAtIndexPath: and call [[self tableView] reloadData];.

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.

Grouped TableView

I want to create a table view which looks like this image! Who can tell me an example or say how can I do this ?
Create a UITableView and set the style to UITableViewStyleGrouped (you can do this programmatically or in the IB).
Then you want 2 sections, the first has 3 rows and the second has 1 row.
You should probably just look in the documentation for UITableView and check out the same code there to get started, but this is the basic format.
This is a good tutorial on customising a grouped UITableView, although it does assume that you are proficient with an image editor to create the various custom images.
Put this in your init method in your UITableView class
[super initWithStyle:UITableViewStyleGrouped];
I have some something similar using grouped static uitableview for creating setting page take a look here Xcode 6 Tutorial Grouped UITableView using Swift