マイアプリ 5.0シミュレータで この4.3.1シミュレータでこれを示しています。テーブルビューtitleForHeaderInSection
これはコードです:
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return @"";
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
return [[Singleton sharedInstance] getTitleSectionView:segmentedControl.selectedSegmentIndex inDay:section];
}
-(UIView *)getTitleSectionView:(int)week inDay:(int)day;
{
UILabel *lab=[[[UILabel alloc]init]autorelease];
lab.frame=CGRectMake(5, 0,320,20);
lab.text=[[Singleton sharedInstance] getTitleSection:week inDay:day];
lab.backgroundColor=[UIColor clearColor];
lab.textColor=[UIColor whiteColor];
lab.font = [UIFont fontWithName:@"Arial" size:14];
UIImageView * imv = [[[UIImageView alloc]initWithFrame:CGRectMake(0,0, 320, 20)]autorelease];
imv.image=[UIImage imageNamed:@"section-header-bg.png"];
UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 20)]autorelease];
[view addSubview:imv];
[view addSubview:lab];
Week *currentWeek = nil;
if(week)
currentWeek = nechetNedel;
else
currentWeek = chetNedel;
NSMutableArray *dayArray = [currentWeek.days objectAtIndex:day];
if([dayArray count] >0)
return view;
return nil;
}
問題となる可能性がどのような、なぜセクションの行が5.0シミュレータで表示されていますか?私は方法- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
を削除しようとしましたが、それは役に立ちませんでした。私はこの方法(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
を削除し、行は
のiOS 5.xの問題(または機能)である 'numberOfSectionsInTableViewたちを表示:'。 –
- (NSInteger)numberOfSectionsInTableView:(のUITableView *)のtableView { リターン7。 } – Pavel
、現在のiOS 5 SIMで茶色がかった灰色のヘッダを数えます。あなたはそれを得る? –