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
Related
Actually I am having problem in displaying around 10-15 rows of Label & Button controls in view. Then I used UIScroll view to achieve this but that corrupt the appearance of design.
As you can see the generated output is different from the appearance in the Xcode while developing.
Please guid me what should be done to render proper design?
Thanks
Ashish
You should use UITableView.
Create custom UITableViewCell.
Your each row will contain one UILabel and UIButton.
You can check.
See the attached image :
Create a custom UITableViewCell and use that one in your code.
And in cellForRowAtIndexPath assign values to your cell properties.
Refer this Apple sample code
Also there are so many examples over net, search for custom UITableViewCell and you will find various tutorials out there.
Here is one more third-party tutorial link:
Hope this helps.
I'd like to replicate the iOS 4.x ABNewPersonViewController UI layout (see link text) in a custom view but I'm unsure about the best way to achieve this. I was thinking of a single grouped UITableView, but what about the first section? How do I achieve the smaller cells (first,last,company)? And finally the "add photo canvas" is it just a sub UIView with a background image for the shadow and the rounded border or can this be done programmatically?
Many thanks in advance!
your idea about a single grouped UITableView could work. The way to get the smaller cells as well as the photo cell would be to subclass UITableViewCell and create it like that. and yes the photo canvus is just a custom UIView added on top of the UITableView. I'm not sure i see the point of rolling your own here, but thats how i'd start. Also i think i recall seeing a tutorial on how to build this page..try googling for it.
looking for some advice on what type of view can be used to build a screen with the following elements:
2 labels followed by 2 buttons.
Then a small table view with 3 rows.
Should a UIView be used or a UITableView?
I've attempted using a UITableView - however I couldn't add the labels or buttons.
So I've now built the view using a UIView. I added the labels and buttons and then a UITableView from the library. However I have no idea how to populate the rows in the table?
Any ideas?
Regards,
Fiona
You could always create the view that you want and return it in the table view delegate's -tableView:viewForHeaderInSection: method. That would give you your table view rows that you want plus your custom view above it.
You need to learn how to use the UITableView before going any further. Time taken now will pay off later on.
There are plenty of tutorials about the UITableView, but I found the best learning I had was from the free iTunes U Standford iPhone course. You don't need to watch it all, but at the very least you should watch the episode on UITableView, as it'll cover everything you need to know. I strongly recommend watching it all, especially the first 8 or so lectures, as it covers the basics of what you need to know really, really effectively.
At the moment, I have a settings view in my iPhone app built with Interface builder, it consists of a background image, some text fields, labels and buttons. Because this looks bad, I want to convert the settings view to an UITableView with custom UITableViewCells.
I already tried adding some cells into my settings view's XIB and returning them in the cellForRowAtIndexPath method (with [return myCell];), as written in Apple's tutorial, but this was not working for me - my whole TableView looked strange and it only showed the first cell correctly.
Is it possible to design these custom cells in Interface Builder? Do I have to create an empty XIB for them or can I put them in my view's XIB? And how do I insert them into my TableView?
Thanks in advance,
Yassin
You can absolutely add custom table cells that you built in interface builder. This includes both static cells and Dynamic cells. However without you providing more information the best I can say is "double check the docs and try again." I can only say that it works and it's rather straightforward so it's hard to say what you may have missed. It might be more helpful if you post what you have for the tableView:cellForRowAtIndexPath method.
Since you say you just have some text fields, I would recommend looking at the technique for static row content section of the Table View Programming guide. You probably would want to have each field of your form correspond to a row in a Segmented Table View, it'll make everything look nicer.
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.