0
我有一个带有2-3个部分的UITableView。我想实现一个功能,可以选择每个部分的单个行。每个UITableViewSection的单选iOS Xamarin
事情是这样: -
我试图使在UITableView的多重选择。但它允许我从所有部分中选择多行。我想从每个部分一次只选择一行。
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.CellAt(indexPath);
if (cell.Accessory == UITableViewCellAccessory.None)
{
cell.Accessory = UITableViewCellAccessory.Checkmark;
}
else
{
cell.Accessory = UITableViewCellAccessory.None;
}
selectedSection = indexPath.Section;
}
public override void RowDeselected(UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.CellAt(indexPath);
cell.Accessory = UITableViewCellAccessory.None;
}