Как сделать прокрутку табличного представления гладкой ... Я вставляю 8 ярлыков и веб-просмотр в каждую ячейку табличного просмотра, потому что прокрутка табличного представления не плавная ... ниже мой код
{
NSMutableArray *arr=[[NSMutableArray alloc]init];
arr =[appDelegate.recentlyaddedarray objectAtIndex:indexPath.row];
NSString *cellValue = [arr objectForKey: @"title"];
#if USE_CUSTOM_DRAWING
const NSInteger TOP_LABEL_TAG = 1001;
UILabel *topLabel;
#endif
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell =[[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
UIImage *indicatorImage = [UIImage imageNamed:@"arrow.png"];
cell.accessoryView =[[[UIImageView alloc] initWithImage:indicatorImage] autorelease];
#if USE_CUSTOM_DRAWING
const CGFloat LABEL_HEIGHT =100;
arr =[appDelegate.recentlyaddedarray objectAtIndex:indexPath.row];
appDelegate.totalComments=[arr objectForKey:@"totalComments"];
appDelegate.totalViews=[arr objectForKey: @"totalViews"];
appDelegate.totalVotes=[arr objectForKey: @"totalVotes"];
appDelegate.textfield=[arr objectForKey: @"title"];
appDelegate.mytextview=[arr objectForKey: @"verse"];
appDelegate.userid=[arr objectForKey: @"user_id"];
appDelegate.added_date=[arr objectForKey: @"addedDate"];
appDelegate.username=[arr objectForKey:@"user_name"];
appDelegate.profilepic=[arr objectForKey:@"profile_pic"];
NSLog(@"%@",appDelegate.profilepic);
CGRect webFrame = CGRectMake(0.0, 0.0,80 ,80 );
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
webView.userInteractionEnabled=FALSE;
[webView setBackgroundColor:[UIColor clearColor]];
webView.opaque=NO;
NSString *htmlTempString = [NSString stringWithFormat:@"<html><body><img src=\"%@\" width=50 height=60 /></body></html>",appDelegate.profilepic];
NSString *htmlTempString = [NSString stringWithFormat:@"\n%@\n %@\n\n\n\n Votes(%@) Views(%@) Comments(%@)",cellValue,appDelegate.added_date,appDelegate.totalVotes,appDelegate.totalViews,appDelegate.totalComments];
[webView loadHTMLString:htmlTempString baseURL:nil];
[cell.contentView addSubview:webView];
[webView release];
topLabel = [[[UILabel alloc] initWithFrame: CGRectMake(70,0,240,LABEL_HEIGHT)] autorelease];
[topLabel setNumberOfLines:-1];
UILabel *Titlelable = [[[UILabel alloc] initWithFrame: CGRectMake(57,4,240,20)] autorelease];
[cell.contentView addSubview:Titlelable];
Titlelable.tag = TOP_LABEL_TAG;
Titlelable.backgroundColor = [UIColor clearColor];
Titlelable.textColor = [UIColor whiteColor];
Titlelable.font=[UIFont fontWithName:@"Arial" size:16];
Titlelable.text = [NSString stringWithFormat:@"\n\n\n\n%@\n",cellValue];
UILabel *usernamelabel = [[[UILabel alloc] initWithFrame: CGRectMake(68,20,240,20)] autorelease];
[cell.contentView addSubview:usernamelabel];
usernamelabel.tag = TOP_LABEL_TAG;
usernamelabel.backgroundColor = [UIColor clearColor];
usernamelabel.textColor = [UIColor whiteColor];
usernamelabel.font=[UIFont fontWithName:@"Arial" size:10];
usernamelabel.text = [NSString stringWithFormat:@"\nBy %@\n",appDelegate.username];
UILabel *Timelabel = [[[UILabel alloc] initWithFrame: CGRectMake(57,40,240,20)] autorelease];
[cell.contentView addSubview:Timelabel];
Timelabel.tag = TOP_LABEL_TAG;
Timelabel.backgroundColor = [UIColor clearColor];
Timelabel.textColor = [UIColor greenColor];
Timelabel.font=[UIFont fontWithName:@"Arial" size:12];
Timelabel.text = [NSString stringWithFormat:@"\n\n\n\n%@\n",appDelegate.added_date];
UILabel *votelable = [[[UILabel alloc] initWithFrame: CGRectMake(101,56,240,20)] autorelease];
[cell.contentView addSubview:votelable];
votelable.tag = TOP_LABEL_TAG;
votelable.backgroundColor = [UIColor clearColor];
votelable.textColor = [UIColor whiteColor];
votelable.font=[UIFont fontWithName:@"Arial" size:12];
votelable.text = [NSString stringWithFormat:@"\n%@\n",appDelegate.totalVotes];
UILabel *viewlable = [[[UILabel alloc] initWithFrame: CGRectMake(155,56,240,20)] autorelease];
[cell.contentView addSubview:viewlable];
viewlable.tag = TOP_LABEL_TAG;
viewlable.backgroundColor = [UIColor clearColor];
viewlable.textColor = [UIColor whiteColor];
viewlable.font=[UIFont fontWithName:@"Arial" size:12];
viewlable.text = [NSString stringWithFormat:@"\n%@\n\n",appDelegate.totalViews];
UILabel *commentlabel = [[[UILabel alloc] initWithFrame: CGRectMake(235,56,240,20)] autorelease];
[cell.contentView addSubview:commentlabel];
commentlabel.tag = TOP_LABEL_TAG;
commentlabel.backgroundColor = [UIColor clearColor];
commentlabel.textColor = [UIColor whiteColor];
commentlabel.font=[UIFont fontWithName:@"Arial" size:12];
commentlabel.text = [NSString stringWithFormat:@"\n\n%@\n",appDelegate.totalComments];
[cell.contentView addSubview:topLabel];
topLabel.tag = TOP_LABEL_TAG;
topLabel.backgroundColor = [UIColor clearColor];
topLabel.textColor = [UIColor lightGrayColor];
topLabel.font=[UIFont fontWithName:@"Arial" size:12];
UIImage *cellBack = [UIImage imageNamed:@"cell.png"];
cell.backgroundView =[[[UIImageView alloc] initWithImage:cellBack] autorelease];
topLabel.text = [NSString stringWithFormat:@"Votes( ) Views( ) Comments( )"];
// topLabel.text = [NSString stringWithFormat:@"\n%@\n\n\n\n Votes(%@) Views(%@) Comments(%@)",appDelegate.added_date,appDelegate.totalVotes,appDelegate.totalViews,appDelegate.totalComments];
// topLabel.text = [NSString stringWithFormat:@"\n%@\n %@\n\n\n\n Votes(%@) Views(%@) Comments(%@)",cellValue,appDelegate.added_date,appDelegate.totalVotes,appDelegate.totalViews,appDelegate.totalComments];
#else
cell.text = [NSString stringWithFormat:@"Cell at row %ld.", [indexPath row]];
#endif
return cell;
}