自己绘制cell

自己画分割线

3

 

self.view.backgroundColor = [UIColorclearColor];

gradeTwoTableView.backgroundColor = [UIColorclearColor];

gradeTwoTableView.backgroundView.backgroundColor = [UIColorclearColor];

gradeTwoTableView.separatorColor = [UIColorclearColor];//1

 

//cell的高50

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

{

    return 50; //2

}

 

//画线的位置为49

UIImageView* lineImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width*0.023, 49, 298, 1)];//3

lineImageView.image = [MHFile imageWithResourceName:@"separate.png"];

[self addSubview:lineImageView];

[lineImageView release];

 

 

自己画框线

//初始化背景

setttingTableView.separatorColor = [UIColorclearColor];

setttingTableView.backgroundColor = [UIColorclearColor];

setttingTableView.backgroundView.backgroundColor = [UIColorclearColor];

setttingTableView.backgroundView = nil;

setttingTableView.separatorStyle = UITableViewCellSeparatorStyleNone;

 

点击的背景框无法改变需要手动改变画线的位置,系统的点击背景框无法改变

posted @ 2012-12-13 09:59  六界剑仙  阅读(152)  评论(0)    收藏  举报