Pourquoi est mon premier en-tête de section dans le tableau ne montre pas?

Je ne peux pas comprendre pourquoi la première section d'en-tête n'est pas visible. La deuxième et la troisième émission de l'amende. Je soupçonne que c'est à cause de la barre de recherche.

J'ai essayé de compenser la totalité de la table comme dans UISearchBar couverts par la section d'en-tête mais je n'ai pas remarqué de décalage.

Pourquoi est mon premier en-tête de section dans le tableau ne montre pas?

Pourquoi est mon premier en-tête de section dans le tableau ne montre pas?

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
//create the parent view that will hold header Label
UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(0,-60,300,60)];
//create the label object
UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.frame = CGRectMake(0,0,self.view.frame.size.width,60);
UIColor* mainColor = [UIColor colorWithRed:47.0/255 green:168.0/255 blue:228.0/255 alpha:1.0f];
headerLabel.backgroundColor = mainColor;
headerLabel.font = [UIFont boldSystemFontOfSize:18];
headerLabel.textAlignment = UITextAlignmentCenter;
if(section == 0)
headerLabel.text = @"Friends";
if(section == 1)
headerLabel.text = @"Second Section Header";
if(section == 2)
headerLabel.text = @"Third Section Header";
headerLabel.textColor = [UIColor whiteColor];
[customView addSubview:headerLabel];
return customView;        
}
- (void) hideSearchBar
{
self.feedTableView.contentOffset = CGPointMake( 0, self.searchBar.frame.size.height );
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//Number of rows it should expect should be based on the section
NSDictionary *dictionary = [_imageDataArray objectAtIndex:section];
NSArray *array = [dictionary objectForKey:@"data"];
return [array count];
}
  • Son travail parfait pour moi êtes-vous changé de contraintes ou de tout?
  • Pas de contraintes. Quand je mets la barre de recherche de / au-dessus de la table dans la table de montage séquentiel, alors je peux voir l'espace pour la tête, mais il est vide...c'Est la barre de recherche de la hiérarchie ok comme il est?
  • yap j'ai mis de la hiérarchie comme ça, ça n'
InformationsquelleAutor jsky | 2014-01-13