UItableView的相關方法設置
(1)TableView顯示detailLabel的方法,設置cell的type:
cell = [[BaseTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1reuseIdentifier:identifier];
(2)顯示右邊向導圖片的方法:
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
(3)TableView自適應高度設置
self.couponTableView.rowHeight?=?UITableViewAutomaticDimension;
self.couponTableView.estimatedRowHeight?=?100;
(4)TableView隱藏點擊效果
<1>關閉交互
<2>設置點擊效果 :?cell.selectionStyle = UITableViewCellSelectionStyleNone;
<3>設置selectedBackgroundView替換原來的
UIView?*view_bg = [[[UIView alloc]initWithFrame:cell.frame]autorelease];
view_bg.backgroundColor?= [UIColor clearColor];
cell.selectedBackgroundView?= view_bg;
(5)設置tableViewCell分割線條的顏色
[theTableView setSeparatorColor:[UIColorredColor]];
(6)設置tableViewCell點擊時候的背景色
UIColor*color=[[UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//通過RGB來定義自己的顏色
cell.selectedBackgroundView=[[[UIViewalloc]initWithFrame:cell.frame]autorelease];
cell.selectedBackgroundView.backgroundColor=[UIColorredColor];
(7)設置tableViewCell選中背景
cell.selectedBackgroundView=[[[UIImageViewalloc]initWithImage:[UIImageimageNamed:@"cellart.png"]]autorelease];
還有字體顏色
cell.textLabel.highlightedTextColor=[UIColorxxxcolor];[cell.textLabel setTextColor:color]
cell.textLabel.opaque = NO; //文本的地方設置透明色
(8)設置tableViewCell的一些系統設置
//無色
cell.selectionStyle=UITableViewCellSelectionStyleNone;
//藍色
cell.selectionStyle=UITableViewCellSelectionStyleBlue;
//灰色
cell.selectionStyle=UITableViewCellSelectionStyleGray;
(9)通過圖片獲取顏色
[UIColorcolorWithPatternImage:[UIImageimageNamed:@"imageName"]];