ios - After coming to landscape mode a white line appears between tableHeader and tableView? -
i made tableview loads data on segment button change.and working perfectly. had set tableview background color rgb values , applying custom header on it.my code follows:-
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { bestfcell *bfcell=(bestfcell*)[tableview dequeuereusablecellwithidentifier:@"bestfcellidentifier"]; if (bfcell==nil) { nsarray *toplevelobjects=[[nsbundle mainbundle] loadnibnamed:@"bestfcell" owner:self options:nil]; (id temp in toplevelobjects) { if ([temp iskindofclass:[bestfcell class]]) { bfcell=(bestfcell*)temp; } } } if (segmentcntr.selectedsegmentindex==0) { bfcell.bestsize.text=[[[bestfivearray objectatindex:indexpath.row] valueforkey:[nsstring stringwithformat:@"bestbuysize%i",indexpath.row+1]] valueforkey:@"text"]; bfcell.bestprice.text=[[[bestfivearray objectatindex:indexpath.row] valueforkey:[nsstring stringwithformat:@"bestbuyprice%i",indexpath.row+1]] valueforkey:@"text"]; }else{ bfcell.bestsize.text=[[[bestfivearray objectatindex:indexpath.row] valueforkey:[nsstring stringwithformat:@"bestsellsize%i",indexpath.row+1]] valueforkey:@"text"]; bfcell.bestprice.text=[[[bestfivearray objectatindex:indexpath.row] valueforkey:[nsstring stringwithformat:@"bestsellprice%i",indexpath.row+1]] valueforkey:@"text"]; } return bfcell; }
//table custom header view .
- (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { bestfcell *bfcell=(bestfcell*)[tableview dequeuereusablecellwithidentifier:@"bestfcellidentifier"]; if (bfcell==nil) { nsarray *toplevelobjects=[[nsbundle mainbundle] loadnibnamed:@"bestfcell" owner:self options:nil]; (id temp in toplevelobjects) { if ([temp iskindofclass:[bestfcell class]]) { bfcell=(bestfcell*)temp; } } } bfcell.bestsize.text=@"best buy size"; bfcell.bestprice.text=@"best buy price"; bfcell.bestsize.font=[uifont systemfontofsize:14.0f]; bfcell.bestprice.font=[uifont systemfontofsize:14.0f]; return bfcell; }
and set footer nil
- (uiview *)tableview:(uitableview *)tableview viewforfooterinsection:(nsinteger)section { uiview *view=[[uiview alloc] init]; return view; }
all fine why white line appears on getting landscape mode.my screen shots follows :- in portrait
and in landscape mode
thanks !..
Comments
Post a Comment