Multiple Cell Images - iphone

Can you place more than one image in a UITableViewCell?

Yes.
You can have 2 images per cell, without customizing.
imageView
accessoryView
You can also add images to the contentView.

The standard UITableViewCell only supports one image (via the imageView.image property).
However, you can make a custom subclass of UITableViewCell and add the desired number of image views.

The simplest way would be to set a custom view (with any number of images) as the cell's contentView.
You could create a custom view and set it as the cell's contentView property. AppleĀ“s Table View Programming Guide for iPhone OS explains in good detail possible strategies for customization of an UITableViewCell.

Related

Design suggestion required in UITableView Swift

I just need a suggestion to Implement tableView for the application.
According to reference image is this a collectionView used in tableView?
Actually I want to implement 4 views on the top of the tableView something like Reminder app of apple. Obviously not to copy design but I need 4 views within UITableView.
These 4 views are also scrollable as its the part of tableview.
I am confused in this how can I achieve this design image attached.
my main concern is 4 top views tile style.
Image
In your case you may better use tableHeaderView property of UITableView and set your "reminder" view as tableHeaderView:
self.tableView.tableHeaderView = myReminderView
If you need to implement it as a cell, for some reasons, just create a custom UITableViewCell subclass and add UICollectionView with all DataSources/Delegates implementations you need inside this cell class.

How to add selected background view to iCarousel in iOS?

As we know, UITableViewCell has a property selectedBackgroundView which enable us to add selected background view to it. But now i'm using iCarousel library and want to add selected background view to it's cell. How can I do it?
You can use subviews to get subviews of iCarousel view. Then you can use isKindOfClass to judge whether it is the cell view. If so, you can directly set background color to it.
You supply the views that are displayed by the carousel so you can add any number of views you want. Indeed UITableViewCell is a type of view so you can use instances of that if you want to.

Glossy button (similar to UISegmentedControl) in UITableViewCell

I have a grouped UITableView with a row per section. I would like the same effect as the UISegmentedControl button (glossy/3D-ish/Modern look). What's the best way to do this without tearing down my UITableView methods code?
Thanks
You don't need to tear down the tableView methods code...
Just have to customize your tableViewCells. Here you can seen how it should be done.
You'll need a glossy background Image or draw it yourself in code dynamically (not recommended)
You can customize UIButton and use it in your cells, or you can directly customize cell background view and text label to make it look like a button.
For customizing the background of the cell: Setting background image of custom table view cells
You may also consider using a simple, ready-to-use custom button component. It also provides a custom cell that you can easily use in your tableviews.
Looks like:

Adding a subview to UITableCellView

I want to add a subview to the UITableCellView class. However, non of the provided views in the class seem to be able to do exactly what I was looking for.
I basically want to add my own background view, filling the whole cell. However, if I replace the backgroundView, the style from the grouped table view layout isn't displayed anymore. If I add a subview to backgroundView, the subview is not shown at all. If I add a subview to the contentView, I can't draw behind the accessory icon.
What am I missing?
Basically you can't change the backgorund of GroupedTable View.
Try using it with PlainTable.
and add the your backgroung image (of size = cellsize) to cellforRowAtIndex method.
You might want to take a look at this article:
"Easy custom UITableView Drawing"
In particular:
First: the UITableView does not itself
draw anything except the background.
To customize the background of a
UITableView, all you need to do is set
its backgroundColor to [UIColor
clearColor] and you can draw your own
background in a view behind the
UITableView.
Simply add the custom view as part of your contentView. Set a unique reuse identifier for that cell, configure it when you create it and from then on simply reset the data components (this is easiest to do if you create a custom cell controller class so that it can track all the parts and use setters/getters for the data).

How to resize a UITableViewCell's accessoryView based on size of cell?

Is it possible for a UITableViewCell's accessory view to be sized based on the size of the UITableViewCell that owns it? How can I achieve this?
Is this a custom accessory view or one of the standard ones? The standard ones only centre in the cell (which is still quite useful) rather than resize. However if you push a UISwitch or other custom view as an accessory view then these might resize.