Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to Manage the UITextView in UITableView Cell?

$
0
0

I am struggling to solve this.

I have UItextview in UITableviewCell. For Example, My table contain 10 records and In my frame 4 records can view. When I scroll my table another records are display by cell reuse. My problem here, when I type the text in first cell's textview , It will display in fifth cell textview too when I scroll. Like the same If I type in second cell,It will display in 6th cell textview too. I think problem in cell reuse.

**_ CommentCustomCell cell = tableView.DequeueReusableCell(cellIdentifier) as CommentCustomCell;

        if (cell == null) 
            cell = new CommentCustomCell (cellIdentifier);



            cell.UpdateCell (indexedTableItems [keys [indexPath.Section]] [indexPath.Row].userName, indexedTableItems [keys [indexPath.Section]] [indexPath.Row].body, indexedTableItems [keys [indexPath.Section]] [indexPath.Row].creationdate, null, indexedTableItems [keys [indexPath.Section]] [indexPath.Row].likes.ToString (), indexedTableItems [keys [indexPath.Section]] [indexPath.Row].disLikes.ToString (), tableView, indexPath);

            //To assign the selected Row Color
            UIView BGViewColor = new UIView ();
            BGViewColor.BackgroundColor = UIColor.Orange; //or whatever color you want.
            BGViewColor.Layer.MasksToBounds = true;
            cell.SelectedBackgroundView = BGViewColor;

_** return cell;

This is my code. Please help me to solve this. Thanks in advance.


Viewing all articles
Browse latest Browse all 204402

Trending Articles