设置UITableViewCell的选中高亮颜色

//无色
cell.selectionStyle = UITableViewCellSelectionStyleNone;

//蓝色
cell.selectionStyle = UITableViewCellSelectionStyleBlue;

//灰色
cell.selectionStyle = UITableViewCellSelectionStyleGray;

Cell Selection Style

The style of selected cells.

typedef enum {
   UITableViewCellSelectionStyleNone,
   UITableViewCellSelectionStyleBlue,
   UITableViewCellSelectionStyleGray
} UITableViewCellSelectionStyle;
Constants

UITableViewCellSelectionStyleNone

The cell has no distinct style for when it is selected.

Available in iOS 2.0 and later.

Declared in UITableViewCell.h.

UITableViewCellSelectionStyleBlue

The cell when selected has a blue background. This is the default value.

Available in iOS 2.0 and later.

Declared in UITableViewCell.h.

UITableViewCellSelectionStyleGray

Then cell when selected has a gray background.

Available in iOS 2.0 and later.

Declared in UITableViewCell.h.

Discussion

You use these constants to set the value of the selectionStyle property.

Declared In
UITableViewCell.h
posted @ 2011-10-12 09:55  Piosa  阅读(3431)  评论(0编辑  收藏  举报