viewForFooterInSection wird nicht am unteren Bildschirmrand angezeigt (uitableview). Hier verwende ich UItableview. viewForFooterInSection wird nicht am unteren Bildschirmrand angezeigt
Hinweis: Im unteren Bildschirmbereich kann der untere Bildschirmrand um eine weitere Fußzeile erweitert werden (weiße Farbansicht). Redcolorview: Fußzeile (von unten Code) blaue Farbe: Tabelle Hintergrundfarbe weiß Boden:
Rote Farbansicht ich programmatisch hinzugefügt, unter Code verwendet:
- (CGFloat)tableView:(UITableView *)tableView
estimatedHeightForFooterInSection:(NSInteger)section
{
return 44;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
NSLog(@"%f",tableView.frame.size.width);
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 44)];
view.backgroundColor = [UIColor redColor];
UIButton *cancelButton = [[UIButton alloc]initWithFrame:CGRectMake(30, 7, tableView.frame.size.width/2 - 60, 30)];
[cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
[cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[cancelButton setBackgroundColor:[ValidationsClass colorWithHexString:NSLocalizedStringFromTableInBundle(@"pothysapp_label_text_backgroundcolor",@"ApplicationSettings",[NSBundle mainBundle], nil)]];
[cancelButton addTarget:self
action:@selector(cancelDetails:)
forControlEvents:UIControlEventTouchUpInside];
cancelButton.titleLabel.font = [UIFont fontWithName:@"Roboto-Bold" size:15];
cancelButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
[view addSubview:cancelButton];
UIButton *saveButton = [[UIButton alloc]initWithFrame:CGRectMake(tableView.frame.size.width/2 + 30, 7, tableView.frame.size.width/2 - 60, 30)];
[saveButton setTitle:@"Save" forState:UIControlStateNormal];
[saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[saveButton setBackgroundColor:[ValidationsClass colorWithHexString:NSLocalizedStringFromTableInBundle(@"pothysapp_label_text_backgroundcolor",@"ApplicationSettings",[NSBundle mainBundle], nil)]];
[saveButton addTarget:self
action:@selector(saveDetails:)
forControlEvents:UIControlEventTouchUpInside];
saveButton.titleLabel.font = [UIFont fontWithName:@"Roboto-Bold" size:15];
saveButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
[view addSubview:saveButton];
return view;
}
Fußzeile Abschnitt auf der Unterseite nicht von der Tabellenansicht Abschnitt erscheint, wenn Ihr Abschnitt genügend Zellen Bildschirm zu decken hat. – dip
Überprüfen Sie den folgenden Link es könnte nützlich für Sie sein https://Stackoverflow.com/a/7238601/5184217 –