Да, как показано на рисунке, не в состоянии добавить разделитель в between.I также попробовал этот
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
NSMutableArray *arrdate=[[NSMutableArray alloc]init];
arrdate=[date1 objectAtIndex:section] ;
NSLog(@"%@",arrdate);
NSMutableArray *arrtime=[[NSMutableArray alloc]init];
arrtime=[time objectAtIndex:section];
NSString *strvalue=[arrdate objectAtIndex:0];
UIView *view;
if([strvalue isEqualToString: strcheck])
{
view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 15)];
/* Create custom view to display section header... */
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, tableView.frame.size.width, 15)];
[label1 setFont:[UIFont boldSystemFontOfSize:12]];
strcheck=[arrdate objectAtIndex:0] ;
NSString *string =[arrtime objectAtIndex:0];
/* Section header is in 0th index... */
[label1 setText:string];
[view addSubview:label1];
}
else{
/* Create custom view to display section header... */
view= [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 100)];
//main time
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, tableView.frame.size.width, 15)];
[label setFont:[UIFont boldSystemFontOfSize:12]];
strcheck=[arrdate objectAtIndex:0] ;
/* Section header is in 0th index... */
[label setText:strcheck];
[view addSubview:label];
//time..
UILabel *labeltime = [[UILabel alloc] initWithFrame:CGRectMake(10,20, tableView.frame.size.width, 15)];
[labeltime setFont:[UIFont boldSystemFontOfSize:12]];
NSString *stringtime =[arrtime objectAtIndex:0];
/* Section header is in 0th index... */
[labeltime setText:stringtime];
[view addSubview:labeltime];
}
return view;
}
но перед проблемой, что вид дата получаю тревожить время прокрутка стола.
Вы пытаетесь добавить заголовок с датой и временем в 2 строках с некоторым разделителем между ними, как показано на изображении? –
Да. Как показано на рисунке m, невозможно добавить разделитель между ними. –