How do I create a rounded table with controls in the cells? - iphone

I'm exploring the iPhone SDK and want to create and use a UI component like the figure below. A rounded table with cells in which each cell can have some label text, maybe an input text field and an action button that would take it to the next screen. The table should not be screen filling.
But... I can't figure out how to do it or find example code. The 'Table View' always seems to result in a screen filling table and although the 'Table View Cell' looks like what I need I can't find any good examples. I'm sure it's all not that hard, but I just can't find it. Any tips, pointers are appreciated.
(This figure is just an example of the sort of UI component I'm looking for, I'm not build something related to flight tracking...)
Table like component http://gerodt.homeip.net/table_ui_component.png
Gero

Try looking at the "5_CustomTableViewCell" project of the TableViewSuite code sample from Apple. It should how to create custom subclasses of UITableViewCell.
The short answer is, as alluded to above, you'll want to subclass UITableViewCell and add your custom UI elements to it. For the example you provided, you'd want two different types of cells; one with a label (in light blue) and content (in black) for 4 of your cells, and then a more complex one with additional text on the right.

You want a Grouped style table, which has sections with rounded elements as you lay out instead of filling the screen.
You also want custom table cells, which you can search here to find example code for.

As mentioned by other answers, what you want is a grouped TableView with custom UITableViewCells. Take a look at the Table View Programming Guide, in particular this section on table view creation and this section on custom cells.

Related

How to create an expandable and collapsable menu WITHOUT a tableviewcontroller

I have a question. I am trying to create an expandable FAQ menu without using a tableviewcontroller. The reason I don't want to use a tableview is because I don't want expandable cells, rather, I want a buttonclick to reveal a label while also sliding down any other buttons on this page.
I'm using Swift in Xcode 7.3
If anyone has any suggestions/knows of a tutorial/a forum post, it would be greatly appreciated.
Thank You.
Sure,nyou could use buttons, and either change constraints on label heights or dynamically add labels. That's a lot of effort and code.
Or, you could use a table view and one of the myriad guides. Remember that table views don't have to be selectable on ever row, and they don't have to display row separator lines (UI).
Indeed you could disable selection on all rows and add buttons to some rows, though I'd personally say that's overkill and why require the user to be 100% accurate with the tap on a button which in your sample image doesn't even look like a button.

iOS Create iBook like interface inside UITableViewCell

I need to display some content inside a grouped table view. At the same time, a cell inside my table has content that exceeds its bounds. I do not want user to scroll to view the entire content.
As an alternative, I want to make this cell such that it has a paged view - the pages are created on the fly based on content length. I will use its backgroundView property which will lay out as pages.
I found UIPageViewController but its design is too complex just for my one cell. Also I could not grasp many parts in it.
I found this library named Leaves but I am not sure there are many examples that have used it successfully. I do not know what I would need to modify in it so as to fit it inside my single cell. The example that is given with it successfully shows PDF and Image along pages, but there is no example of plaintext rendering.
Any pointers? Any other sources that can suit my purpose?
Why don't you use the cell view that would resize itself according to the text contet. So if some cells have larger text content and some have smaller text it would automatically resize the cell. Here is a two part tutorial that does exactly the trick you are looking for. Hope it helps you out.
http://www.raddonline.com/blogs/geek-journal/iphone-sdk-resizing-a-uitableviewcell-to-hold-variable-amounts-of-text/

iOS white background behind settings controls

Is there a control that can achieve the appearance that is in this image?
It looks like some special single round cornered table cell a UISlider embedded in it.
What I am wondering is it really a table cell, it seems overkill to do this. Is it possible there is something in iOS to achieve this without using an UIimage as a background.
Thanks,
-Code
Looks like a grouped table view section with one view in it. That custom table view cell in the grouped table view section looks to have a UISlider with a UILabel on either side of it.
As a general rule, you should always lean toward using the standard built in controls unless you really need a custom look.
See the third image here: http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/tableview_iphone/AboutTableViewsiPhone/AboutTableViewsiPhone.html
Also:
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/tableview_iphone/TableViewStyles/TableViewCharacteristics.html
From that link:
Grouped Table Views
A grouped table view also displays a list of
information, but it groups related rows in visually distinct sections.
As shown in Figure 1-4, each section has rounded corners and by
default appears against a bluish-gray background. Each section may
have text or an image for its header or footer to provide some context
or summary for the section. A grouped table works especially well for
displaying the most detailed information in a data hierarchy. It
allows you to separate details into conceptual groups and provide
contextual information to help users understand it quickly.

ios UITableView - functioning like a dropdown list

Requirement : implementing a drowdown functionality in an UIView
The known way is using a UIWebView.
My Q is can this be done via a TableView?
Is there any way which lets me select a section(just like selecting a row), so that I can implement a hide/show cells of a section when that particular section is selected?
Don't know if I am understanding you correctly, but it seems to me that what you want can be done like this:
have a UITableView with several sections;
each section has got just one row;
when a specific row for a section is selected (didSelectRowAtIndex), you change the data source associated to that section by adding more elements and reloadData on the table.
when a specific row for a section is selected you also modify the data source corresponding to any other section so that it only contains one row.
EDIT:
From your last comment, it seems to me that what you are trying to do is a generic dropdown menu: you click somewhere and it displays; now, in your specific case you are thinking of clicking on a table, but it could in principle be anywhere else. I am saying this (if I am not wrong), because if it is so, then you can find ready-made implementations, like WEPopover, and you could save some effort.
Going back to your asking, in the case you are mentioning, you can animate the height of the table view frame (or bounds), so that its content is displayed little by little, as the view height increases; have a look at this Tutorial about Core Animations.

Editable UITableViewCell having a left-aligned label

I am very new to iphone application development and am struggling to create a table view page where each row contains a left-aligned label with an editable text next to it - just like how it works in the email account details page in the settings application on my iphone.
I have been googling the subject for hours and it is now somehow clear to me that I need to add UITextFields to UITableViewCells, but it is still not at all clear to me how I make these text fields take up the right amount of space:
How do I make the text fields align above each other?
How do I make the text fields expand as far as possible to the right?
How do I prevent the text fields from hiding part of the left-aligned label?
Read the Apple Docs on Tableviews there are a number of predefined table cells. Also look at the Tableview programming Guide. Pick the one that has the font characteristics that you want and Apple will take care of it for you. Also, in the Settings app, the settings are a Grouped style.
For the look you are describing I think it is called UITableViewCellStyleSubtitle.
You need custom UITableViewCells and there are a number of ways of making them. For your purposes, any one of the techniques detailed in the Apple documentation will probably suffice.
An alternative to those approaches is in GSUtils (full disclosure: open-source library written by me), where you can use the same approach to designing your table view cells as you would design a UIView.