Labels are overlapping in Xamarin.IOS and dimension also not expanding with respect to content.
Code in ViewController:
List<class> listofdata = databaseconnectivity.GetListofData(1);
TableViewSource tableViewsourceObj = new TableViewSource(listofdata, this);
tableView.Source = tableViewsourceObj;
tableView.RowHeight = UITableView.AutomaticDimension;
Code in GetCell method of TableView Source
var cell = tableView.DequeueReusableCell((Foundation.NSString)"TVCellIdentifier");
var cell2 = (VersesTvcCell)cell;
cell2.UpdateCell(listofdata[indexPath.Row].field1, listofdata[indexPath.Row].field2);
return cell2;
Code in UpdateCell method of UITableViewCell
Label1.Text = field1;
Label2.Text = field2;
移除两个标签的顶部对齐并增加它们之间的垂直间距。
You need to set constraint as below .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.