Example #1
0
            public void ReloadUI(AnswerListRow row, UITableView tableView)
            {
                var post = row._post;

                _text.Text = row._body;

                _details.Text = BclEx.OffsetFromNow(post.creation_date) + " by";
                _author.SetData(row._controller, post.owner);
                _details2.Text = string.Format("{0}\uD83D\uDC4D  {1} comments", post.score, post.comments != null ? post.comments.Count : 0);

                float titleHeight = row.GetHeightTitle(tableView);

                _text.Frame     = new RectangleF(6, 0, tableView.Frame.Width - 24, titleHeight);
                _details.Frame  = new RectangleF(6, titleHeight, _details.StringSize(_details.Text, _details.Font).Width, 20);
                _author.Frame   = new RectangleF(_details.Frame.X + _details.Frame.Width + 4, titleHeight, _author.StringSize(_author.Text, _author.Font).Width, 20);
                _details2.Frame = new RectangleF(6, 20 + titleHeight, tableView.Frame.Width - 24, 20);

                if (post.is_accepted)
                {
                    _tick.Frame = new RectangleF(_details2.StringSize(_details2.Text, _details2.Font).Width + 10, _details2.Frame.Y, 20, 20);
                }
                else
                {
                    _tick.Frame = RectangleF.Empty;
                }

                if (row._isDetails)
                {
                    _text.Frame = RectangleF.Empty;
                }
            }
Example #2
0
            public void ReloadUI(AnswerListRow row, UITableView tableView)
            {
                var post = row._post;

                _text.Text = row._body;

                _details.Text = BclEx.OffsetFromNow(post.creation_date) + " by";
                _author.SetData(row._controller, post.owner);
                _details2.Text = string.Format("{0}\uD83D\uDC4D  {1} comments", post.score, post.comments != null ? post.comments.Count : 0);

                float titleHeight = row.GetHeightTitle(tableView);

                _text.Frame = new RectangleF(6, 0, tableView.Frame.Width - 24, titleHeight);
                _details.Frame = new RectangleF(6, titleHeight, _details.StringSize(_details.Text, _details.Font).Width, 20);
                _author.Frame = new RectangleF(_details.Frame.X + _details.Frame.Width + 4, titleHeight, _author.StringSize(_author.Text, _author.Font).Width, 20);
                _details2.Frame = new RectangleF(6, 20 + titleHeight, tableView.Frame.Width - 24, 20);

                if (post.is_accepted)
                    _tick.Frame = new RectangleF(_details2.StringSize(_details2.Text, _details2.Font).Width + 10, _details2.Frame.Y, 20, 20);
                else
                    _tick.Frame = RectangleF.Empty;

                if (row._isDetails)
                    _text.Frame = RectangleF.Empty;
            }