Sunday, 15 April 2012

iphone - How can I hide bottom separator in some UITableViewCell -



iphone - How can I hide bottom separator in some UITableViewCell -

i'm developing app using uitableview grouped style , want hide cells bottomseparator don't know how.

this result want : result want

i've tried :

[self.tableview setseparatorstyle:uitableviewcellseparatorstylenone]; [self.tableview setseparatorcolor:[uicolor clearcolor]];

and :

uiimageview *line = [[uiimageview alloc] initwithframe:cgrectmake(12, height_row_header, 320-(12*2), 1)]; line.backgroundcolor = [uicolor blackcolor]; [cell addsubview:line];

but don't have borders around uitableview

i have thing : result have

someone can help me ?

thank lot

first of need remove separatorcolor , setseparatorstyle.

[self.tableview setseparatorstyle:uitableviewcellseparatorstylenone]; [self.tableview setseparatorcolor:[uicolor clearcolor]];

then check if cell lastly cell of section need add together image in cell.

viewnormal=[[uiview alloc] initwithframe:cgrectmake(0, 59, cell.frame.size.width, 1)]; uibutton *btn = [uibutton buttonwithtype:uibuttontypecustom]; btn.frame = viewnormal.bounds; btn.enabled = no; [btn setbackgroundimage:[uiimage imagenamed:@"linebgimage.png"] forstate:uicontrolstatenormal]; [viewnormal addsubview:btn]; [cell addsubview:viewnormal];

and remove viewnormal other cell. adding separator way , working fine for. hope help you.

iphone objective-c uitableview separator

No comments:

Post a Comment