Hi i have tried to set custom view on tableview header but custom view is not fit to header.
Custom view is coming like below image,in this image custom view is orange color and header view is gray color.But i want fit custom view is full of header view.
please help.
myCode:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *sectionView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, _TableList.frame.size.width, 80)];
header = [[HeaderView alloc] initWithFrame:CGRectMake(sectionView.frame.origin.x, sectionView.frame.origin.y, sectionView.frame.size.width, sectionView.frame.size.height)];
[sectionView addSubview:header];
sectionView.tag=section;
sectionView.backgroundColor = [UIColor grayColor];
UITapGestureRecognizer *headerTapped = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sectionHeaderTapped:)];
[sectionView addGestureRecognizer:headerTapped];
return sectionView;
}