multiple cells in one row - iphone

I have read a few posts about what I need but I can't manage to do this.
I want a table that could be set up like an image, it will have a regular background image and from half the screen to the bottom i want the table view to have 6 different cells
How can I do this. I have done this with buttons and my app is working with no problems, but I wanna do this with table also

Why dont you use AQGridView. Its an extension of uitableview and you need not worry much about other things.

Spire you can easily add six buttons in one table row or three buttons in one row (two rows then). You can easily assign tag number (based on indexPath.row.. like indexPath.row + 1, indexPath.row + 2 ...etc). and in there action method you can use these tag numbers...
to create customized cells follow these links -
http://adeem.me/blog/2009/05/30/iphone-sdk-tutorial-part-6-creating-custom-uitableviewcell-using-interface-builder-uitableview/
http://www.e-string.com/content/custom-uitableviewcells-interface-builder

The image doesn't look like a table view. It should be a custom view. UITableView can contain single UITableViewCell per row. If you still want to create a table view like that, you have to customize each cell to have three different views like that.
If you don't want table view, you should customize your view to achieve something like that.

Related

how to create a sectioned TableView for profile in iPhone

I saw this picture on Internet:
the section with the add Photo Frame and two rows (First, Last)...
How do you achieve a design like that!!!
I only know how to make rows (static and dynamic) in xCode using the full width of the screen but not in a single section but not making such a divisiĆ³n and adding a frame out of the other two rows
my designs are like this
Any help I'll appreciate
thanks in advance
It's not really clear that the example you've given is actually embedding the first, last part into a table view. It could just as easily be a single cell that has embedded views with borders to look like rows. Here are a few ways I see to accomplish the view you've given.
Have them be actual rows - but use a custom cell layout that offsets the 'First' and 'Last' labels to be further to the right. Then create a UIImageView for the profile that sits on top of the UITableView cells, but inside of it. Basically insert it as the first subview of the UITableView. It should cover the top left of those top two cells. You can do this since those cells have a static known hight and you've set the left offset. Another option would be just inserting it into your top cell, but having it overflow the bounds and setting clipsToBounds = NO.
Make the entire top view a custom UIView that uses CALayers or CoreGraphics to manually draw the lines and layout such that it looks like part of the table view. Set that as the TableView header, or the first section Header.
There are a lot more things you can do like changing frame layout as well.
you can achieve this with the use of xib read carefully and if you don't understand anything you can ask me again it's bit tricky
in you xib create a UIView and design for your photo and firstname, lastname cells with the use of textfields image views and all and then take a UITableView.
now drag your UIView and drop it on your UITableView so that it will be considered as your table header and your first section now will be as you designed like photo with firstname and lastname fields.
i've done this in manier projects of mine so hope this way you can also do this thing and ask me if you need any help.

How to make a UITable with columns?

I was wondering how to make a UITable have columns. Or, is there a better way to create an actual table that looks like a grid. I want to have 3 columns. How can I do this?
The UITableView doesn't have support for more than one column. However, this can be easily fixed if you create your own custom UITableViewCell-s. You would need to stash three different views into the cell and then add whatever you want in them.
If you don't mind the fact that you cannot scroll horizontally you can just use a custom UITableViewCell to give the illusion of columns. If you really want columns (like a spreadsheet) you need to subclass UIScrollView and implement UITableView-like view caching. Luckily Apple has some sample code which shows how to do this, see TiledScrollView.m

buttons in a table header to load tdifferent table views

What's the best way for me to add 2 custom buttons in the header of my UITableView?
On clicking either of those buttons, a different table View is loaded.
Thanks for the help!
Add the two buttons to the header, and use the IBActions of those buttons each to set the datasource to an other array. After that, use [tableView reloadData];
If you want to use buttons above the table, I'd suggest either using sections if your having no sections in your original table, or placing a toolbar above your table.
UISegmentedControl is pretty much for this purpose, then you can hook the events and switch the views accordingly... It looks better tan two separate buttons, and also better from the user experience perspective...
Second choice is to have two different tables or one table with two different data. I would prefer two tables, each having its own data, and delegates. Easier to write cell rendering code and all...
If both data are of the same type like "Array of MyObject", then you can come away with just a flag and some ( flag ? firstDataArray : secondDataArray) type of selections in the table delegate methods.
First add two different customs button and then add two different table Views bellow that custom buttons.
Use a separate UView and add both UIButton as subview into.
Then add this button's view in the parent view of your UITableView
Then both the button's view and UITableView will be the sibling view....

Create a view like Tweetie's User Profile view

I'm just wondering if anyone has any idea on how you can create a view that looks like the user profile view in apps like Tweetie, where there are seemingly multiple tables with a couple of normal (straight up and down tables) and then two rows of six cells, which in Tweeties case have the number of followers, following etc.
I'm trying to make a similar view for my app, but can't seem to find out the best way to create it. Any tutorials, advice etc. would be appreciated.
Thanks.
P.S. Here's a picture of the view which I'm trying to recreate.
alt text http://technopedia.info/wp-content/uploads/2009/09/tweetie22.jpg
To get the same effect as Tweetie's split cell, create a custom cell and add a Segmented Control and create title and detail labels
It is a grouped tableview using custom cells. The image you show has two visible sections, and the top of a third. It also has a custom table header view. The second section has two cells built from four UILabels and a dividing line graphic in the middle. You can create this in a nib, or by hand.
You can even change the grey pin-stripe background if you want.

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.