Glossy button (similar to UISegmentedControl) in UITableViewCell - iphone

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:

Related

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.

how do i fully customize a tableview

i want to customize my tableview, like the tipulator app for the iphone.
And heres my app:
Each UITableViewCell has a few subviews which you can replace with your own. They are:
UITableViewCell.imageView
UITableViewCell.contentView
UITableViewCell.backgroundView
UITableViewCell.accessoryView
As Gendolkari pointed out, Cocoa With Love has a great guide on custom UITableViews.
The theory is that you replace each of those views with an appropriate view to "skin" your UITableViewCells.
When replacing the background view, you check for the first and last cells when skinning the background view, otherwise you can use a "middle" background image. Implement it as a UIImageView. As far as the other views, use what you want.
Additionally, you can use a completely custom NIB file and load that in instead of the default styles provided by UIKit.
While the others are right in suggesting ways to subclass UITableView or its components, this screenshot doesn't look like it's showing a UITableView.
My guess is that they're just drawing custom images onto a background and checking certain areas for taps. What you should do is read up on the drawing methods as well as on intercepting taps and touches.
Here's a really good guide on custom styling for your table:
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
Create your own UITableViewCell, and use it, rather than a "generic" one.
You can do this directly in XCode with "File->New File" Then in "Cocoa Touch Class", choose "Objective-C Class" - and under the "Subclass" popup, select "UITableViewCell".
It well generate a XIB, which you can use in IB to customize the look.
Instantiate and pass-in there cells in your UITableView code, instead of the normal UITableViewCells.

How do I hide the UITableViewCell border for a custom cell in a group tableview?

What I am trying to do: I want three buttons side-by-side in a tableviewcell just like in Contacts app.
What I've done: I have a custom tableviewcell with three uibuttons in it. I've set the background color of the tableviewcell to be transparent.
What I can't figure out: The tableviewcell border is still there! Everything looks great except for the border floating around the 3 buttons.
Am I doing this completely wrong? Or is there a simple way to remove/hide the border?
Thanks!!!
Don't put these in a cell. Simply create a custom UIView that contains the three buttons, and use that view as your Table's footer:
[myTableView setTableFooterView:customUIViewWithButtons];
Good luck!
What about if I want my transparent cell in the middle?

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).

UITableViewCell action badge

Does anyone know how to implement an action badge, like the ones seen below with the price tags in them. The App Store has those too.
alt text http://m.macupdate.com/images/screens/uploaded/30815_scr.png
The easiest way is to set the accessoryView of a standard UITableViewCell to a UIView. You can just make them be standard UIButtons, set their background color and the label color and font.
If they're not meant to be interactive, then you can use a container UIView with a UIImageView in the background and a UILabel in the front added as subviews.
If you want to get fancy with it you'll have to subclass UITableViewCell and lay out the various bits yourself. It's not that difficult. The TableViewSuite sample code shows you how.
I am not sure there is anyway within the framework to create this type of button. You could fairly easily simulate it using your own custom images. What you want in this case is a stretchable image that does not distort as you resize the buttons.
Take a look at the following method on the UIImage class:
- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight