iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
When uses dynamic height supported UITableViewCell, I found that the incremental loading behavior is strange.
On iOS 8.0 or higher platform:
The UITableViewController will incremental load data several times, it may have 3 or more http requests sent out at same time (page index range may be 10-20, 20-30, 30-40). After data loaded, the table will refresh and scroll bar may move to top (sometimes then move back to current postion).
On iOS 7.0 platform:
When scrolls the content to the bottom and incremental loading begins, an Unhandled exception will be thrown, and the app will exit.
This issue only happens when uses UITableViewCell that implements ISupportDynamicHeight and UITableViewController set to TableViewCellStyle.Custom. Please take a look.
public partial class CommentReplyCell : UITableViewCell, ISupportDynamicHeight
{ public static readonly UINib Nib = UINib.FromName("CommentReplyCell", NSBundle.MainBundle); public static readonly NSString Key = new NSString("CommentReplyCell"); ... ... #region ISupportDynamicHeight Members public void WillDisplay(ITableViewController viewController, object item) { AppSimpleUserReply userReply = item as AppSimpleUserReply; if (userReply != null) { if (userReply.IsBanned) { TitleLabel.Frame = new CGRect(ReplierImageView.Frame.Right + 4, BanIconView.Frame.Bottom + 6, Bounds.Width - ReplierImageView.Frame.Right - 8, 1); } else { TitleLabel.Frame = new CGRect(ReplierImageView.Frame.Right + 4, CreatedDateLabel.Frame.Bottom + 6, Bounds.Width - ReplierImageView.Frame.Right - 8, 1); } TitleLabel.SizeToFit(); // Attachment Position switch (userReply.AttachmentType) { case 0: break; case 1: AttachmentImageView.Frame = new CGRect(ReplierImageView.Frame.Right + 4, TitleLabel.Frame.Bottom + 4, 96, 96); break; case 2: break; case 3: break; } } } public float GetHeight(ITableViewController viewController, object item) { AppSimpleUserReply userReply = item as AppSimpleUserReply; if (userReply != null) { var leftHeight = ReplierImageView.Frame.Bottom + 8; var rightHeight = CreatedDateLabel.Frame.Bottom; if (userReply.IsBanned) { rightHeight += 4; rightHeight += BanIconView.Bounds.Height; rightHeight += 6; } else { rightHeight += 6; } rightHeight += TitleLabel.SizeThatFits(new CGSize(TitleLabel.PreferredMaxLayoutWidth, 1)).Height; // Attachment position switch (userReply.AttachmentType) { case 0: break; case 1: rightHeight += 4; rightHeight += AttachmentImageView.Bounds.Height; break; case 2: break; case 3: break; } rightHeight += 8; return (float) Math.Max(leftHeight, rightHeight); } return 0; } #endregion }
Is there any problems? I tested code on my iPhone, the cell layout and height is OK. The only issue is data incremental loading.
Hi Leo,I'm unsuccessfully replicating the problem can you give me sample of your program?
Please take a look at my sample. WebAPI is hosting on my web server.
Too many requests when incremental loading.
WebAPI.zip
Hi Leo,Did you swipe the UI so fast? and how your internet? I already try in 7.0 and 8.0 however i only try in crosslight samples, the problem only happen when i swipe the UI quickly, it will sometime send 10-50 data and move into top but i use rather fast internet, i will update you about this issue.
My internet connection is also fast, about 20Mb/s, my server bandwidth is 1Mb/s.
I think this issue happens when the first response data is loaded but the UI is still calculating, and then the second request sends out immediately, when the second response data is also loaded into memory, the UI tries to reload UITableView and cannot decide current scroll position.
Just my imagination.
This issue should happen when swipe the UI so fast, or the layout of the UITableViewCell is too complicated to perform WillDisplay and GetHeight.
Hi LeoOur developer investigating this issue right now, i will update you with new information about this issue :)
Hi Leo,Our development team has successfully identified the issue and already done creating the hotfix, you can download the hotfix here: http://git.intersoftpt.com/projects/CROS/repos/updates/browse/Crosslight3_0_5000_211Yes you are right about the problem by the way, thanks for the information and you feedback! :)
Hi Leo,Looks like i encounter error when running your new samples (Index was out of range), can I use your old samples which still functional? (obtained in the top)Did i'm still must swipe fast to reproduce the issue?
Hi Leo,Thanks for the samples i can run it successfully, i will check the three issues (scroll, image loader, and incremental) using this samples now.Please note i use Crosslight v4 to test this issues (to check whether it already fixed in v4), also you can expect cool new features in v4 by the way! (like view projection, which only obtain needed data make your list become so much faster)
Hi Leo,This is confirmed a bug and already reopen the issue (CROS-748) i will update you with new information regarding this issue, estimate fix maybe after v4.Best Regards,Arief
Hi Leo,We release the hotfix for CROS-748 which you can downloaded here: http://git.intersoftpt.com/projects/CROS/repos/updates/browse/Crosslight4_0_5000_300Hope that will helps!
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname