How to remove the split line in the group style of IOS UItableView, iosuitableview
When you customize UItableView, when the selected style is Group, the split line is usually set to transparent. To remove the style, you only need to reset a BackgroundView to overwrite the original one.
// Cancel the split line
UIView * view = [[UIView alloc] init] autorelease];
[Cell setBackgroundView: view];
// Click Cancel
Cell. selectionStyle = UITableViewCellSelectionStyleNone;
IOS TableViewCell custom split line
The product design requires that the cell split line length not be the whole screen width, and the design requires that the split line is 2px (two), with different colors on and off. Implementation: Change the split line style to None tableView in UITableView. separatorStyle = response; custom UITableViewCell write-(void) drawRect :( CGRect) rect method-(void) drawRect :( CGRect) rect {CGContextRef context = Response (); context (context, [UIColor clearColor]. CGColor); CGContextFillRect (context, rect); // upper split line, CGContextSetStrokeColorWithColor (context, [UIColor colorWithHexString: @ "ffffff"]. CGColor); CGContextStrokeRect (context, CGRectMake (5,-1, rect. size. width-10, 1); // CGContextSetStrokeColorWithColor (context, [UIColor colorWithHexString: @ "e2e2e2e2"]. CGColor); CGContextStrokeRect (context, CGRectMake (5, rect. size. height, rect. size. width-10, 1 ));}
How to remove the cell border and background in the grouped style UITableView
_ TableView. backgroundView = nil.
The test shows that it is OK, but I don't know whether the previous version has backgroundView or not, so I 'd better add a judgment: if (mainTableView.
BackgroundView ){
MainTableView.
BackgroundView = nil;} if the type is UITableViewStylePlain, [UIColor clearColor] is still valid, which is strange!
Under normal circumstances, the grouped style (
UITableViewStyleGrouped
) UITableViewCell has borders. To remove borders, you can use:
UIView * tempView = [[UIView alloc] init] autorelease];
[Cell setBackgroundView: tempView];
In fact, it is very easy to set the backgroundView to an empty View, and then it is clean.