1016-06-homepage 20-encapsulation toolbar --- distance between UITableView control and top ---- background color settings when cell is selected, and toolbar on top of android
1. Set the spacing between the cell on the top and the cell on the top of the UITableView:
Method 1. directly set: self. tableView. contentInset = UIEdgeInsetsMake (HWStatusCellMargin, 0, 0, 0 );
@ Interface HWHomeViewController: UITableViewController
@ End
@ Implementation HWHomeViewController
-(Void) viewDidLoad
{
[Super viewDidLoad];
Self. tableView. contentInset = UIEdgeInsetsMake (15, 0, 0, 0 );
}
@ End
Method 2. Rewrite setFrame in cell:
-(Void) setFrame :( CGRect) frame
{
Frame. origin. y + = 15;
[Super setFrame: frame];
}
Method 3. Add the y value of the sub-control in each microblog (each cell) to 15
Ii. Background color settings when cell is selected:
-(Void) tableView :( UITableView *) tableView didSelectRowAtIndexPath :( NSIndexPath *) indexPath
{
// Set the selected background to blue
// UIView * bg = [[UIView alloc] init];
// Bg. backgroundColor = [UIColor blueColor];
// Self. selectedBackgroundView = bg;
// This method is not feasible.
// Self. selectedBackgroundView. backgroundColor = [UIColor blueColor];
// HWLog (@ "didSelectRowAtIndexPath --- % @", NSStringFromUIEdgeInsets (self. tableView. contentInset ));
}