I need to have a sectioned tableview like the following. I need a section to look like shown in the following image.
Home on one side, then on the other column Street, City, state, zipcode. And also Country and state should be on another row.
If someone could show me some sample code or a tutorial to start on this
note : you get the following UI when you are trying to add an address to a contact using your iPhone and sorry i don't have any code, i am clueless where to start.
Get creative. Sometimes something looks like a tableViewCell but it actually isn't one ;-)
Just a bunch of UIViews with lightGray backgroundColor and a width or height of 1. And those are arranged in cells that have different heights.
Related
it is my first question in the forum, although I have been reading for quite a long time.
I am trying to design a tableviewcell with XCode 10 in swift for accessing to documents that are translated into many languages. So what I want is to show the text of the document title and below, a CHIP (material-design) with the flag icon and the capital letters of the language.
I have made a sketch to show that:
https://i.imgur.com/fnS5Szn.jpg (i can not post images yet)
I read the information in the webpage for the material design, specifically the section for CHIPS in iOS: https://material.io/develop/ios/components/chips/
But all the information is in Objective-C, not in swift, and I have no idea of what they explain.
I have also take a look at cosmicmind material framework because it says in the readme file that one of the features is CHIPS, however I havent been able to find the example for CHIPS in the samples section.
Hope you can help me to design the cell.
Thanks in advance.
Well, I think I have solved the problem myself by using a collectionview embedded in the tableviewcell.
Within the storyboard, in the tableviewcontroller, add a prototype cell, give the height that you want, add a label with the "document title" and add a collectionview.
Add a prototype cell to the collectionview, give it the size you want, add a background, the flag icon and the language capital letters and that's all.
Drag and drop the outlets of the collectionview and the tableview, and set the tableview as the delegate for the collectionview... and you are done.
To make it look like an Android chip you should round the corners by adding in the tableviewcell, at "cellforrowat":
cell.chipBackground.layer.cornerRadius = 20
And then it will look like in Android.
I leave a snapshot of the result:
document list with different languages
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/
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.
The tableview I am implementing is a kind of phonebook, where I have an entry(name) and below that I am displaying his/her phone numbers. These data make my cell.
An entry(name) can have multiple phone numbers(each phone number displayed in different lines). Against each phone number(in the same line) I have an option to set some status message. How can I implement this.
The way I have gone forward is:
I have created a 2 labels inside a cell. One for displaying the name and the other for displaying the numbers. These numbers are displayed in a multiline way. The problem I am facing is, adding the status message against each phone number(in the same row of each number). For that I may have to add the status as text in between the phone numbers(displayed in a multiline way) in the same label or I have to add another label inside this label. I am a bit confused regarding, how to go about this. Need help.
For multiple UILable in a cell, you can use custom cell.
What you are trying to implement is something like this or this. check it out.
Personnaly, I would add the "To" view as a subview of your UILabel and then set the toView.frame.origin.y to index * label.font.lineHeight.
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.