KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this wierd problem with my table i Have about 20 cells to display Each cell is about 84px in height When i click no the cell, i have set a background colour The first 4 cells are ok, but when i scroll down and click on the 5th cell, the content of each cell starts to overlap with some other content, usually content from 1st 4 cells. I belive its some cell reusability or drawing issue. Am not sure how to solve it, i have checked through my code, but i am not changing the cell's content on touch. Here is my code and will add some pics too - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 104; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [stores count]; } -(UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; CGRect Label1Frame = CGRectMake(5, 5, 250, 30); CGRect Label2Frame = CGRectMake(6, 42, 220, 20); CGRect Label3Frame = CGRectMake(6, 62, 220, 20); CGRect Label4Frame = CGRectMake(240,56, 70, 12); UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; }else{ // a cell is being recycled, remove the old edit field (if it contains one of our tagged edit fields) UIView *viewToCheck = nil; viewToCheck = [cell.contentView viewWithTag:1]; if (!viewToCheck) { [viewToCheck removeFromSuperview]; DebugLog(@"View removed"); } } //cell.selectionStyle=UITableViewCellSelectionStyleNone; [cell s
Tags (comma-separated)
Save Edits
Cancel