I'm using Xamarin to develop a mobile app in ios.
The problem is that when you scrolling the UITableView lags and its too slow.
Here my method GetCell:
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
string identifier = @"PostCell";
var post = Posts [indexPath.Row];
PostCellVC postCell = tableView.DequeueReusableCell (identifier) as PostCellVC;
if (postCell == null)
{
postCell = new PostCellVC (identifier);
}
postCell.btnComments.SetTitle("0 Comments",UIControlState.Normal);
postCell.lblDescription.Text = post.PostText;
postCell.btnComments.SetTitle(string.Format("{0} Comments",post.Comments.Length.ToString()),UIControlState.Normal);
postCell.btnLikes.SetTitle(post.Likes.ToString() + " Likes",UIControlState.Normal);
postCell.btnUser.SetTitle(post.UserName.ToString(),UIControlState.Normal);
postCell.imgLike.Image = UIImage.FromBundle ("Images/likeOn.png");
var actionSheet = new UIActionSheet ("Share options");
actionSheet.CancelButtonIndex = 2;
actionSheet.AddButton ("Facebook");
actionSheet.AddButton ("Twitter");
actionSheet.AddButton ("Cancel");
postCell.lblFecha.Text = GetPrettyDate (post.Date);
//postCell.btnShare.TouchUpInside += share;
if (post.PictureUrl != null) {
postCell.imgPost.Image = LayoutHelper.ImageFromUrl (post.PictureUrl);
}
return postCell;
}